formatAmountFromDouble method

int formatAmountFromDouble(
  1. dynamic scale
)

Implementation

int formatAmountFromDouble(scale) {
  try {
    double correctAmount = this * (pow(10, scale));

    return int.parse(correctAmount.toStringAsFixed(0));
  } catch (e) {
    inspect(e);
  }

  return -1;
}