ChemPal Documentation - v1.6.0
    Preparing search index...
    • Format a USD amount for display in the user's currency, reusing the same conversion the results table applies so history values match the table.

      Parameters

      • usd: number

        The amount in USD.

      • OptionaluserSettings: PriceHistorySettings

        The user's currency/rate settings.

      Returns string

      The localized currency string (e.g. "$19.99").

      formatUsd(19.99, { currency: "EUR", currencyRate: 0.9 }); // => "€17.99"
      
      export function formatUsd(usd: number, userSettings?: PriceHistorySettings): string {
      return formatDisplayPrice({ usdPrice: usd, price: usd, currencyCode: 'USD' }, userSettings);
      }