@pwngh/economy-lab
    Preparing search index...

    Function usd

    • Builds a USD amount from a decimal string, with the full strictness of decodeAmount: more than two decimal places, digit grouping, or a value past the 64-bit range throws INVALID_AMOUNT.

      Parameters

      • decimal: string

      Returns Amount

      const price = usd('9.99'); // 999n minor units
      const payoutValue = usd('100.00'); // what 20,000 credits cash out to at $0.005 per credit