toShortString method
Converts the double to a string, omitting decimal places if it's an integer.
Implementation
String toShortString() {
if (this % 1 == 0) {
return toInt().toString();
} else {
return toString();
}
}
Converts the double to a string, omitting decimal places if it's an integer.
String toShortString() {
if (this % 1 == 0) {
return toInt().toString();
} else {
return toString();
}
}