Format a number into currency.
Usage:
// Default usageformatMoney(12345678);// => $12,345,678.00// European formatting (custom symbol and separators)formatMoney(4999.99, { symbol: "€", precision: 2, thousand: ".", decimal: "," });// => €4.999,99// Negative values can be formatted nicelyformatMoney(-500000, { symbol: "£ ", precision: 0 });// => £ -500,000// Simple `format` string allows control of symbol position (%v = value, %s = symbol)formatMoney(5318008, { symbol: "GBP", format: "%v %s" });// => 5,318,008.00 GBP Copy
// Default usageformatMoney(12345678);// => $12,345,678.00// European formatting (custom symbol and separators)formatMoney(4999.99, { symbol: "€", precision: 2, thousand: ".", decimal: "," });// => €4.999,99// Negative values can be formatted nicelyformatMoney(-500000, { symbol: "£ ", precision: 0 });// => £ -500,000// Simple `format` string allows control of symbol position (%v = value, %s = symbol)formatMoney(5318008, { symbol: "GBP", format: "%v %s" });// => 5,318,008.00 GBP
Amount to be formatted
Optional
Object containing all the options of the method
Format a number into currency.
Usage: