---
title: "How to use localized number in Flutter?"
description: "Learn how to use localized number in Flutter with the NumberFormat class. Format numbers in the user's locale and display them in a familiar format. Examples included."
category: flutter
date: 2023-03-29
updated: 2026-10-09
canonical: https://localizely.com/i18n-questions/flutter/how-to-use-localized-number-in-flutter/
---

# How to use localized number in Flutter?

To use localized numbers in Flutter, you can use the `NumberFormat` class from the [intl](https://pub.dev/packages/intl) package. This class provides methods for formatting and parsing numbers based on the user's locale.

To format a number in a specific locale, you can create an instance of the `NumberFormat` class with the desired locale, and then use the `format` method to format the number. Here's an example of formatting a number in English and German:

```dart
double number = 123456.789;

String formattedNumberEn = NumberFormat.decimalPattern('en').format(number);
print(formattedNumberEn); // 123,456.789

String formattedNumberDe = NumberFormat.decimalPattern('de').format(number);
print(formattedNumberDe); // 123.456,789
```

You can also format numbers in your localization messages using either the [gen_l10n](/blog/flutter-localization-step-by-step/?tab=using-gen-l10n) or [Flutter Intl](/blog/flutter-localization-step-by-step/?tab=automated-using-flutter-intl) approaches and generated localization code will handle that for you. Here is an example of such a message in ARB file:

```json
"pageHomeSampleTotalAmount": "Total: {total}",
"@pageHomeSampleTotalAmount": {
  "placeholders": {
    "total": {
      "type": "double",
      "format": "currency",
      "optionalParameters": {
        "symbol": "€",
        "decimalDigits": 2
      }
    }
  }
}
```

Source: https://localizely.com/i18n-questions/flutter/how-to-use-localized-number-in-flutter/
