FLUTTER ECOSYSTEM

Naddiseo/dart-sprintf

sprintf का Dart लागू करना

dart-sprintf प्रोजेक्ट कवर
Stars
89
Forks
20
अंतिम पुश (UTC)
31 अक्टू॰ 2022
प्रोजेक्ट स्थिति
सक्रिय
no GitHub avatar
GITHUB User

no ↗

n/aearth
भाषाएँDartPython

तकनीकी विषय

इस रिपॉज़िटरी के पैकेज

उपयोग की गई निर्भरताएँ

निर्भरता सूची 2 आइटम
  • testडेवलपमेंट^1.16.0-nullsafety.13
  • lintsडेवलपमेंट^1.0.1

मूल README

यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।

README खोलें / बंद करें

dart-sprintf

Dart implementation of sprintf.

Build Status

ChangeLog

ChangeLog.md

Getting Started

Add the following to your pubspec.yaml:

dependencies:
  sprintf: "^7.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.