getValueInUnitBI method

num getValueInUnitBI(
  1. PolyUnit unit
)

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

Implementation

num getValueInUnitBI(PolyUnit unit) => quantity ~/ _factors[unit]!;