doubleToInt method
Implementation
int doubleToInt (double input) {
try {
String? stringValue = input.toString();
int index = stringValue.indexOf('.');
int amount = int.parse(stringValue.substring(0, index));
int cents = int.parse(stringValue.substring(index + 1));
int concat = int.parse('$amount$cents');
return concat;
} catch(error) {
return 0;
}
}