https://github.com/shaunthegeek/dart-trim-zero
remove .0 from the end of Dart number string, give you a pretty number or price
https://github.com/shaunthegeek/dart-trim-zero
Last synced: about 1 month ago
JSON representation
remove .0 from the end of Dart number string, give you a pretty number or price
- Host: GitHub
- URL: https://github.com/shaunthegeek/dart-trim-zero
- Owner: shaunthegeek
- License: mit
- Created: 2024-09-17T10:12:59.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-17T13:11:57.000Z (8 months ago)
- Last Synced: 2025-02-18T17:06:08.071Z (3 months ago)
- Language: Dart
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/sinkcup/dart-trim-zero/actions/workflows/dart.yml)
[](https://pub.dev/packages/trim_zero)
[](https://pub.dev/packages/trim_zero/publisher)A Dart library that removes trailing zeros from the end of a number string and gives you a nicely formatted number string.
## Usage
```dart
print('0.010'.trimZero()); // 0.01double price = 99.00;
print(price.toString().trimZero()); // 99
```## Development Guide
- [Creating packages | Dart](https://dart.dev/guides/libraries/create-packages)
- [Extension methods | Dart](https://dart.dev/language/extension-methods)