mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Display non-field errors as returned from the server
This commit is contained in:
parent
b7f9f1c55f
commit
2886f7c930
4 changed files with 87 additions and 20 deletions
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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue