--- title: "formatPrice" slug: helpers-formatprice category: generic type: documentation version: 20.0.0 tokens: 253 source: https://ovh.github.io/design-system/v20.0.0/llms/helpers-formatprice--documentation.txt --- # formatPrice ## Specifications Format a numeric value to a price matching given locale format with expected currency. | Argument | Type | Default | Description | |---|---|---|---| | `value` | `number` | - | The numeric value to format. | | `locale` | `string` | 'fr-FR' | The locale to use. | | `currency` | `string` | 'EUR' | The currency expected. | - [Intl.NumberFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) ## Examples ### Default ```tsx <>{ formatPrice(123456.789) }> ``` ### Locales ```tsx <>
France: { formatPrice(123456.789, 'fr-FR') }
Germany: { formatPrice(123456.789, 'de-DE') }
Arabic: { formatPrice(123456.789, 'ar-EG') }
India: { formatPrice(123456.789, 'en-IN') }
> ``` ### Currencies ```tsx <>Euro: { formatPrice(123456.789, 'fr-FR', 'EUR') }
Dollar: { formatPrice(123456.789, 'fr-FR', 'USD') }
Yen: { formatPrice(123456.789, 'fr-FR', 'JPY') }
> ```