numberAutoDigit static method
set digit number if decimal equal to "0" then auto return int number as String
Implementation
static String numberAutoDigit(double value, [int maxDigit = 3]) {
if (value.toInt() == value) {
return value.toInt().toString();
} else {
int digit = value.toString().split('.').last.length;
if (digit > maxDigit) return value.toStringAsFixed(maxDigit);
return value.toString();
}
}