mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 10:15:32 +00:00
Display non-field errors as returned from the server
This commit is contained in:
13
lib/helpers.dart
Normal file
13
lib/helpers.dart
Normal file
@ -0,0 +1,13 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
Reference in New Issue
Block a user