getValueInUnitBI method

BigInt getValueInUnitBI(
  1. EtherUnit unit
)

Gets the value of this amount in the specified unit as a whole number. WARNING: For all units except for EtherUnit.wei, this method will discard the remainder occurring in the division, making it unsuitable for calculations or storage. You should store and process amounts of ether by using a BigInt storing the amount in wei.

Implementation

BigInt getValueInUnitBI(EtherUnit unit) => _value ~/ _factors[unit]!;