convertToDecimals method

Amount convertToDecimals(
  1. int newDecimals
)

Implementation

Amount convertToDecimals(int newDecimals) {
  if (newDecimals == decimals) return this;

  final newAmount = value * BigInt.from(10).pow(newDecimals - decimals);

  return Amount(
    value: newAmount,
    decimals: newDecimals,
  );
}