Sarraf API
    Preparing search index...

    Function toMinor

    • Convert a major-unit amount to integer minor units with string math (no float division). toMinor("250.00", "EGP") === 25000, toMinor("1.250", "KWD") === 1250. Throws if the value has more precision than the currency allows (non-zero extra digits).

      Parameters

      • major: string | number
      • currency: Currency

      Returns number