modules/utils/utils/string_number_utils
library
Functions
-
doubleStringWithoutTrailingZeros(String? doubleString)
→ String
-
Given a number string this will display decimals just if it contains them
For example
0.012 => 0.012
3.2 => 3.2
2.0 => 2
-
formattedPrice(double? price, [String? symbol])
→ String
-
Returns a string representing a formatted price with currency
A custom
symbol
can be provided to be used instead
-
isStrNil(String? string)
→ bool
-
Check if given string is empty or null
-
numberToRoundedValue(dynamic number, {String orElse(dynamic)?})
→ String
-
Given an object this function will try to parse as double and round the value
returning a string
It also provides a fallback function
orElse
to use if the value processed is an invalid number
by default this returns 0
if no fallback provided