Viewing version 1.0.2. Open the latest package page.
sprintf
1.0.2Dart implementation of sprintf
Readme
dart-sprintf
Dart implementation of sprintf.
Getting Started
Add the following to your pubspec.yaml:
dependencies:
sprintf:
git: git://github.com/Naddiseo/dart-sprintf.git
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.
Changelog
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'sprintf:1.0.2'pubspec.yaml
name: sprintf
version: 1.0.2
description: >
Dart implementation of sprintf
author: Richard Eames <dartsprintf@naddiseo.ca>
homepage: https://github.com/Naddiseo/dart-sprintf
dependencies:
unittest: any
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 1.0.0-alpha1 | Cached · Upstream SHA-256 matched | Download | a6728ba2…7ae081 |
| 1.0.1 | Cached · Upstream SHA-256 matched | Download | 61082cd0…906598 |
| 1.0.2 | Cached · Upstream SHA-256 matched | Download | 7f7da7ae…b36e80 |
| 1.0.3 | Cached · Upstream SHA-256 matched | Download | 91c5252f…b1c10b |
| 1.0.4 | Cached · Upstream SHA-256 matched | Download | 23567a5a…4ce230 |
| 1.0.5 | Cached · Upstream SHA-256 matched | Download | a7f26d36…8373e5 |
| 1.0.6 | Cached · Upstream SHA-256 matched | Download | 378e7458…7f9b2b |
| 1.0.7 | Cached · Upstream SHA-256 matched | Download | 1ba6bbb7…e76fc6 |
| 1.0.8 | Cached · Upstream SHA-256 matched | Download | dd5354ba…7df63b |
| 3.0.0 | Cached · Upstream SHA-256 matched | Download | 192621df…fa6196 |
| 3.0.1 | Cached · Upstream SHA-256 matched | Download | fbce46f6…6b4aa3 |
| 3.0.2 | Cached · Upstream SHA-256 matched | Download | c1488c52…5c66c4 |
| 4.0.0 | Cached · Upstream SHA-256 matched | Download | 99f2e397…5379f2 |
| 4.0.1 | Cached · Upstream SHA-256 matched | Download | 4f4023cc…b6f7d5 |
| 4.0.2 | Cached · Upstream SHA-256 matched | Download | fc340e40…02a991 |
| 4.0.3 | Cached · Upstream SHA-256 matched | Download | 55e2bb72…b6bfdd |
| 4.1.0 | Cached · Upstream SHA-256 matched | Download | e5b1c200…bb1625 |
| 5.0.0 | Cached · Upstream SHA-256 matched | Download | b6041625…71c27a |
| 6.0.0-nullsafety | Cached · Upstream SHA-256 matched | Download | f21cf219…c5c03c |
| 6.0.0 | Cached · Upstream SHA-256 matched | Download | 936056f5…9fc526 |
| 6.0.2 | Cached · Upstream SHA-256 matched | Download | ec76d389…0776d1 |
| 7.0.0 | Cached · Upstream SHA-256 matched | Download | 1fc9ffe6…120f23 |
Dependencies
unittest "any"