format static method

int format(
  1. double amount,
  2. int decimals
)

Format a given amount with the decimals.

Implementation

static int format(double amount, int decimals) {
  return (amount * (pow(10, decimals))).toInt();
}