2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 13:36:50 +00:00
inventree-app/lib/helpers.dart

13 lines
364 B
Dart

/*
* A set of helper functions to reduce boilerplate code
*/
/*
* Simplify a numerical value into a string,
* supressing trailing zeroes
*/
String simpleNumberString(double number) {
// Ref: https://stackoverflow.com/questions/55152175/how-to-remove-trailing-zeros-using-dart
return number.toStringAsFixed(number.truncateToDouble() == number ? 0 : 1);
}