sprintf 1.0.7

  • README.md
  • Installing
  • Versions
  • --

dart-sprintf #

Dart implementation of sprintf.

Build Status

Getting Started #

Add the following to your pubspec.yaml:

dependencies:
  sprintf: ">=1.0.7 <2.0.0"

then run pub install.

Next, import dart-sprintf:

import 'package:sprintf/sprintf.dart';

Example #

import 'package:sprintf/sprintf.dart';

void main() {
	print(sprintf("%04i", [-42]));
	print(sprintf("%s %s", ["Hello", "World"]));
	print(sprintf("%#04x", [10]));
}
-042
Hello World
0x0a

Limitations #

  • Negative numbers are wrapped as 64bit ints when formatted as hex or octal.

Differences to C's printf

  • When using fixed point printing of numbers with large exponents, C introduces errors after 20 decimal places. Dart-printf will just print 0s.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sprintf: ^1.0.7

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:sprintf/sprintf.dart';
  
Version Uploaded Documentation Archive
4.0.2 Feb 20, 2019 Go to the documentation of sprintf 4.0.2 Download sprintf 4.0.2 archive
4.0.1 Feb 19, 2019 Go to the documentation of sprintf 4.0.1 Download sprintf 4.0.1 archive
4.0.0 Jul 28, 2018 Go to the documentation of sprintf 4.0.0 Download sprintf 4.0.0 archive
3.0.2 Aug 18, 2017 Go to the documentation of sprintf 3.0.2 Download sprintf 3.0.2 archive
3.0.1 Aug 18, 2017 Go to the documentation of sprintf 3.0.1 Download sprintf 3.0.1 archive
3.0.0 Apr 20, 2017 Go to the documentation of sprintf 3.0.0 Download sprintf 3.0.0 archive
1.0.8 Oct 9, 2013 Go to the documentation of sprintf 1.0.8 Download sprintf 1.0.8 archive
1.0.7 May 7, 2013 Go to the documentation of sprintf 1.0.7 Download sprintf 1.0.7 archive
1.0.6 Apr 16, 2013 Go to the documentation of sprintf 1.0.6 Download sprintf 1.0.6 archive
1.0.5 Mar 29, 2013 Go to the documentation of sprintf 1.0.5 Download sprintf 1.0.5 archive

All 15 versions...

Awaiting analysis to complete.