toBetterString method
Implementation
String toBetterString({int decimals = 1}) {
final String decimalPart = toString().split(".").last;
if (decimalPart.split("").any((element) => element != "0")) {
return toStringAsFixed(decimals);
}
return toStringAsFixed(0);
}