significant_format 0.0.1 copy "significant_format: ^0.0.1" to clipboard
significant_format: ^0.0.1 copied to clipboard

outdated

A new Flutter package project.

significant_format #

This package provides a SignificantFormat class which formats a double value in significant figure in roundup or truncate mode. If locale is provided in input, the number will be formatted with thousands separator (, or .) according to the locale provided.

Buy Me A Coffee

Getting Started #

In your flutter project add the dependency:

dependencies: 
 ... 
 significant_format:

Usage example #

import 'package:significant_format/significant_format.dart'

void main() {
// format 0.000012345 with 4 significant figure using truncate
// formatted = 0.00001234 
String formatted = SignificantFormat().truncate(0.000012345, 4);

// format 12345 with 4 significant figure using roundup
// formatted = 12350
String formatted = SignificantFormat().roundup(12345, 4);

// pass optional locale will format the value as amount which containing thousands separator
// amount = 12,350
String amount = SignificantFormat().roundup(12345, 4, locale: "en");
}
2
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter package project.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, intl

More

Packages that depend on significant_format