Localizely logo
  • Home
  • Getting started
  • How it works
  • Pricing
  • FAQ
Sign up

I18n questions · Flutter

How to use localized number in Flutter? 

To use localized numbers in Flutter, you can use the NumberFormat class from the 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:

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 or Flutter Intl approaches and generated localization code will handle that for you. Here is an example of such a message in ARB file:

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

Published Mar 29, 2023 · Last reviewed Oct 9, 2026 · Markdown version

Related Flutter internationalization questions:

Flutter internationalization tutorial:

Learn about internationalization in Flutter
Localizely logo
About
Free tools
Boring stuff
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • Compare
Newsletter
Copyrights 2026 © Localizely