Canton dApp Booster
    Preparing search index...
    • Scales a decimal string to an integer at precision, which is the only exact way to compare two amounts. undefined when the value is not a decimal or carries more places than precision can hold, since dropping a digit would silently change the amount.

      Reach for validateAmount instead where the caller needs to say what went wrong.

      Parameters

      • value: string
      • precision: number = DEFAULT_PRECISION

      Returns bigint | undefined

      parseAmount('1.5') // 15000000000n