Przejdź do głównej zawartości

Function: formatPriceRange()

formatPriceRange(minPrice, maxPrice, locale?): string

Format a price range (min - max). Returns a single price when min equals max by string comparison (no numeric conversion).

Parameters

minPrice

PriceMoney

maxPrice

PriceMoney

locale?

string

Returns

string

Example

formatPriceRange(
{ amount: "10.00", currencyCode: "USD" },
{ amount: "50.00", currencyCode: "USD" },
'en-US'
)
// => "$10.00 - $50.00"