---
title: "formatCurrency"
description: "The module formatCurrency is a function that formats numbers to currency with the native api [Intl.NumberFormat](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) from browsers and Node.js"
package: "@maz-ui/utils"
url: "https://maz-ui.com/ecosystem/utils/currency"
---

# formatCurrency

> The module formatCurrency is a function that formats numbers to currency with the native api [Intl.NumberFormat](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) from browsers and Node.js

- Package: `@maz-ui/utils`
- Import: `import { formatCurrency } from '@maz-ui/utils/helpers/formatCurrency'`
- Web: https://maz-ui.com/ecosystem/utils/currency

**Tip:**

This module uses the native api [Intl.NumberFormat](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) from browsers

Enter only numbers

```vue
<script lang="ts" setup>
import { formatCurrency } from '@maz-ui/utils'
import { computed, ref } from 'vue'

const numberValue = ref(69)

const priceFormatted = computed(() =>
  formatCurrency(numberValue.value, 'fr-FR', { currency: 'EUR' }),
)
</script>

<template>
  <MazInput v-model="numberValue" type="number" />

  <div
    style="padding: 16px; margin-top: 16px; background-color: var(--maz-surface-300);"
  >
    {{ priceFormatted }}
  </div>
</template>
```

## Options

> All options from [Intl.NumberFormat](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) are availables

```ts
export interface FilterCurrencyOptions extends Intl.NumberFormatOptions {
  round?: boolean
}
```
