text property

String get text

If fractionDigits is 0, the value is formatted with no decimal places. Otherwise, it is formatted with the specified number of decimal places, and trailing zeros are removed.

Example:

String number = null.text;
print(number); // Output:

number = 15.0005.text;
print(number); // Output: 15

number = 15.0505.text;
print(number); // Output: 15.05

Implementation

String get text => toText(2);