use-shopping-cart
formatCurrencyString()
formatCurrencyString()
formatCurrencyString formats the prices of the products. It takes an object shaped like this:
Name | Type |
---|---|
value | number |
currency | string |
language (optional) | string |
{ value: 400, currency: 'USD', language: 'EN' //optional}
If you don't pass a value to language, it will choose language based on the browsers settings
import { formatCurrencyString } from 'use-shopping-cart/src/util'formatCurrencyString({ value, currency })// returns $4.00