# General Translation Platform: formatCurrency URL: https://generaltranslation.com/en-GB/docs/platform/core/reference/utility-functions/formatting/format-currency.mdx --- title: formatCurrency description: Format a currency value by locale without a GT instance. API reference for formatCurrency. --- [`formatCurrency`](/docs/platform/core/reference/gt-class-methods/formatting/format-currency) is a standalone utility function from General Translation's Core library that formats a numeric value as a localised currency string. It wraps the built-in `Intl.NumberFormat` API using the currency style. ## Overview [#overview] Import `formatCurrency` directly from `generaltranslation` and call it with a value, a currency code, and an options object. It does not require an API key or a [GT](/docs/platform/core/reference/gt-class/constructor) instance. For instance-based formatting that inherits the instance locale, use the [`formatCurrency`](/docs/platform/core/reference/gt-class-methods/formatting/format-currency) method on a [`GT`](/docs/platform/core/reference/gt-class/constructor) instance instead. ```typescript import { formatCurrency } from 'generaltranslation'; const price = formatCurrency(1234.56, 'EUR', { locales: ['de-DE'] }); // "1.234,56 €" ``` Signature: ```typescript formatCurrency( value: number, currency: string, options?: { locales?: string | string[] } & Intl.NumberFormatOptions ): string ``` ## How it works [#how-it-works] * **Underlying API.** Uses the same [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) with `style: 'currency'` as the GT class method. * **Locale resolution.** When `locales` is omitted, it falls back to the library's default locale, `en`. * **Symbol placement.** The currency symbol, grouping separators, and decimal format follow the resolved locale. ## Parameters [#parameters] | Parameter | Description | Type | Optional | Default | | ----------------------- | --------------------------------------------------------- | ------------------------------------------------------------- | -------- | ------- | | [`value`](#value) | The numeric amount to format. | `number` | No | — | | [`currency`](#currency) | The ISO 4217 currency code, such as `USD` or `EUR`. | `string` | No | — | | [`options`](#options) | Formatting configuration, including the target locale(s). | `{ locales?: string \| string[] } & Intl.NumberFormatOptions` | Yes | `{}` | ### `value` [#value] **Type** `number` · **Required** The numeric amount to format. ### `currency` [#currency] **Type** `string` · **Required** The ISO 4217 currency code, such as `USD`, `EUR`, or `JPY`. ### `options` [#options] **Type** `{ locales?: string | string[] } & Intl.NumberFormatOptions` · **Optional** · **Default** `{}` Formatting configuration: | Property | Description | Type | Optional | Default | | --------- | --------------------------------------------------------- | -------------------- | -------- | ------------ | | `locales` | Locale(s) for formatting. | `string \| string[]` | Yes | `en` | | `style` | Number formatting style; defaults to currency formatting. | `string` | Yes | `'currency'` | ## Returns [#returns] **Type** `string` The value formatted as a localised currency string. ## Examples [#examples] ```typescript import { formatCurrency } from 'generaltranslation'; // US dollars console.log(formatCurrency(1234.56, 'USD', { locales: 'en-US' })); // Output: "$1,234.56" // Euros, German locale console.log(formatCurrency(1234.56, 'EUR', { locales: 'de-DE' })); // Output: "1.234,56 €" // Japanese yen (no fractional digits) console.log(formatCurrency(1234, 'JPY', { locales: 'ja-JP' })); // Output: "¥1,234" ``` ## Notes [#notes] * Always pass an explicit `locales` value for correct, deterministic output. * Pass any `Intl.NumberFormatOptions` (for example, `minimumFractionDigits`) alongside `locales` to fine-tune the output.