@uplift-ltd/money
Installation
npm i --save @uplift-ltd/money
API
formatCurrency
Format an amount.
import { formatCurrency } from "@uplift-ltd/money";
formatCurrency(123.45, "USD"); // => $123.45
formatCurrency("12345.67", "USD"); // => $12,345.67
formatCurrency(null, "USD"); // => $0
parseAmount
Parse a money string into a number.
import { parseAmount } from "@uplift-ltd/money";
parseAmount("123.45 USD"); // => 123.45