Master Localized Numbers in 5 Minutes

Localization
Chidinma Egwuogu
21 Sep 2023

10 min. read

Contents

Ordering a pizza and getting a thousand pizzas instead? Unfortunately, that's not a bonus. That’s a number localization bug.

Localized numbers might seem like a small part of your localization project, but getting them wrong can cost you money, trust, or even customers.

This article breaks down the nuances of numbers localization and offers tips to get numbers right for every audience.

Pro tip: Mistakes in number localization can lead to costly errors. Use Centus’ robust quality control checks to detect and correct localization oversights before you ship. Learn more.

What are localized numbers?

Localized numbers refer to the presentation of numbers in a format that's familiar and understandable to the target audience. This includes elements like decimal points, thousand separators, currency symbols, date formats, and even phone number structures. For example, while the United States uses a period as a decimal separator (e.g., $1.50), many European countries use a comma (e.g., €1,50).

what are localized numbers

Why are numbers localization important?

  • Improved user experience: People are used to seeing numbers in a specific format based on their cultural and regional backgrounds. Presenting numbers in a localized manner ensures that your content connects with your audience and is easy for them to understand.
  • Trust building: Incorrect number formats can come across as foreign or even suspicious to users. Localizing numbers can help instill trust and confidence in your brand.
  • Avoiding misunderstandings: A misplaced decimal or the wrong date format can cause significant confusion. Accurate and localized numbers prevent misinterpretation, which could lead to potential business losses or customer dissatisfaction.
  • Legal and compliance reasons: Some countries have specific regulations on how numbers, especially financial ones, should be presented. Localizing numbers isn't just about user experience. It also ensures compliance with international standards.

Numbers localization: decimal and thousand separators

Numbers, while universally understood, are presented differently across cultures. One significant difference lies in the decimal point and thousand separator.

Decimal separators are used to separate a number from its fractional part, while thousand separators help segment larger numbers for easier readability.

Standard numbers: In the US, the number ten thousand is written as 10,000, while in many European countries, the same number is written as 10.000. In French, the number 1234.56 is written as 1 234,56, where the space ( ) between 1 and 2 is the thousand separator and the comma (,) is the decimal separator.

The Indian numbering system is also unique. Rather than the more common "thousands" grouping, they often use a "lakhs" and "crores" system. For instance, what would be 10,000,000 in many Western countries is represented as 1,00,00,000 in India, signifying 1 crore.

Scientific notation: This is used for exceptionally large or small numbers and has variations based on regions.

For instance, in the USA, the number 12,300 in scientific notation is represented as 1.23 x 10^4. In Germany, it's 1,23 x 10^4, using a comma as the decimal separator.

The table below highlights the differences in decimal and grouping presentation across countries:

Country/region Decimal and grouping presentation
United States 1,234,567.89
United Kingdom 1,234,567.89
Germany 1.234.567,89
France 1 234 567,89
Brazil 1.234.567,89
India 12,34,56,789.89
China 1,234,567.89
Switzerland 10'000.00
Arabic-speaking regions ١٬٢٣٤٬٥٦٧٫٨٩

How to localize:

  • For web developers working with HTML, CSS, or JavaScript, using classes or pseudo-classes can help mark numbers with the correct separators. The lang attribute is essential. By specifying, for instance, <html lang="es">, it indicates the use of Spanish formatting.

  • Libraries that manage number localization are another lifesaver. In JavaScript, we have Intl.NumberFormat. Python users have their locale module, while Java developers can opt for the NumberFormat class.

  • When handling scientific notation in software, always provide options for both commas and periods as decimal separators. This ensures that the notation is correctly presented based on the user's locale.

  • For platforms targeting specific regions, consult local educational or scientific publications to ensure the notation aligns with local standards.

  • Regardless of the method, ensure your platform recognizes the user's locale and, importantly, always test to confirm accuracy, especially in contexts like e-commerce or finance.

Date formats localization

Date formats can vary depending on the language, region, or culture of the user. The day, month, and year sequence, separators, and even calendar systems can all differ.

These subtle differences can appear unimportant, yet they can cause major misunderstandings. For example, 04/07/2022 could be interpreted as April 7th in the U.S. but July 4th in many other countries.

Country/region Date format Presentation
United States MM/DD/YYYY 04/07/2022
United Kingdom DD/MM/YYYY 07/04/2022
Germany DD.MM.YYYY 07.04.2022
Japan YYYY/MM/DD 2022/04/07 or 2022年04月07日
China YYYY-MM-DD 2022-04-07
Canada DD/MM/YYYY or MM/DD/YYYY 07/04/2022 or 04/07/2022

How to localize:

  • Use the HTML5 <input type="date"> element for date input fields to ensure automatic localization based on the user's settings. Providing a placeholder or format guideline can prevent user confusion.

  • For JavaScript projects, consider libraries like Intl.DateTimeFormat for date manipulation and localization.

  • In Java, the SimpleDateFormat class can be used for date formatting and localization, while Python has the datetime module.

  • Leaving users to guess dates is not the answer. Always validate and store dates in a consistent format, like ISO 8601, then convert them for display based on the user's locale for clarity and consistent data handling.

To learn more about number localization in Java, read our comprehensive guide.

Time formats localization

Just as date formats differ, the manner in which time is represented varies from one region to another. The differences are mainly centered around the 12-hour versus 24-hour clock format, but there are other nuances too, such as the terms used for AM and PM.

For instance, the military and many European countries opt for a 24-hour clock, eliminating the need for AM and PM. Some countries, on the other hand, use different figures to show this notation.

Country/region Time format Example Notation for AM/PM
United States 12-hour 2:30 PM AM/PM
United Kingdom 24-hour 14:30 -
Germany 24-hour 14:30 -
Japan 12-hour 2:30 午後 午前 (AM), 午後 (PM)
China 12-hour 2:30 下午 上午 (AM), 下午 (PM)
India 12-hour 2:30 PM AM/PM

How to localize:

  • For web applications, consider using HTML5's <input type="time"> or <input type=“datetime-local”>.

  • For other languages, you can use the libraries and modules specified in the date format section above.

  • To eliminate confusion, allow users to choose their preferred time format in application settings. Furthermore, always validate time inputs to be sure they’re accurate.

Currency localization

Different languages have specific symbols for their currency and also follow unique symbol placement conventions(before the amount, after, with a space, or without).

Below is a table showcasing the variations in currency symbol placement across different countries:

Country/region Currency Symbol Example
United States US Dollar $ $100
United Kingdom British Pound £ £100
European Union Euro 100€
Japan Yen ¥ ¥10,000
China Yuan ¥ or 元 ¥100 or 100元
India Rupee ₹100

How to localize:

  • The Intl.NumberFormat object in JavaScript provides a way to format numbers according to the language and locale conventions. You can use this syntax:

Intl.NumberFormat('en-US', {style: 'currency', currency: 'target currency'})

.format(monetary_value);

  • Java has the NumberFormat class, which provides methods for formatting numbers and parsing currencies. Python, on the other hand, has the locale module for similar purposes.

  • Always ensure that the user knows which currency they're dealing with, especially in e-commerce settings. Consider giving options for currency conversion or displaying an approximate value in the user's local currency next to the original amount.

Phone numbers localization

Each country has its unique phone number structure, length, rules, and country calling codes. These codes vary greatly, from +1 for the United States and Canada to +91 for India.

Some international phone number variations include:

Country/region Country code Sample phone number Notes
United States +1 +1 212-555-1234 10-digit national format.
United Kingdom +44 +44 7123 456789 Mobile numbers begin with 07 but use country code +44.
Germany +49 +49 030 12345678 8 to 11 digits, depending on region and type.
Japan +81 +81 03-1234-5678 City code followed by a local number.
China +86 +86 131 2345 6789 Mobile numbers often start with specific prefixes like 131.
India +91 +91 98765 43210 Mobile numbers are typically 10 digits long.
Nigeria +234 +234 812 345 6789 Mobile numbers typically start with specific network prefixes, like 812.

How to localize:

  • Use libraries like Google’s libphonenumber to format, parse, and validate phone numbers.

  • Implement an automatic format suggestion or dropdown list for country codes based on the user's selected country.

Percentages localization

Percentages are presented differently across cultures and languages. In English, for instance, the percentage sign is placed directly after the number, as seen in 10%.

Conversely, in Turkish, the sequence is reversed, with the percentage sign preceding the number, like %10.

Meanwhile, the French system has a space between the number and the percentage sign, producing 10 %.

Language/region Example Notes
English (US) 50% Percentage sign directly after the number.
French 50 % Space between number and percentage sign.
Turkish %50 Percentage sign before the number.
Arabic %٥٠ Arabic numerals with the percentage sign preceding it.
Chinese (China) 50% or 百分之五十 Uses the percentage sign or the phrase "百分之" before the number.

How to localize:

  • In JavaScript, use the Intl.NumberFormat, while NumberFormat works for Java.

  • When dealing with databases, store percentages in a universal format so you can apply localization upon retrieval or display.

  • When possible, let users choose their preferred format for display and ensure it covers major variations.

Units of measurement localization

The units of measurement we use to describe length, weight, volume, temperature, and more, are deeply rooted in history, culture, and scientific conventions. While the metric system is widely accepted across many nations, other systems such as the imperial and US customary units are predominant in the United States, Myanmar, and Liberia.

Notable differences in units of measurement across various regions include:

Measurement type Metric system US customary/imperial Other notable systems
Length Metres, cm Feet, inches Chi (China), Sun (Japan)
Weight Kilograms, g Pounds, ounces Stone (UK), Tahil (Malaysia)
Volume Litres, ml Gallons, quarts, pints Shi (Japan), Pint (UK different than US)
Temperature Celsius Fahrenheit Kelvin (Scientific use)
Area Square meters Square feet Pyeong (South Korea)
Speed km/h mph Knot (Nautical)

How to localize:

  • When designing an international product or website, provide a feature that allows users to switch between units of measurement.

  • Use geolocation or browser settings to automatically detect a user's location and adjust the default units of measurement accordingly. Remember to provide an option for users to manually change this if needed.

  • If your content targets a global audience, always clarify which unit system you are referring to. For instance, "miles (mi)" or "kilometers (km)" can prevent confusion.

  • Many software libraries and APIs offer functionality to automatically convert between different units of measurement. For example:

  • JavaScript: The convert-units library can be used for converting between different units.

  • Python: The pint library provides a comprehensive system for unit conversion.

  • Java: The javax.measure package (part of the Java EE platform) allows for precise unit conversion and formatting.

  • C#/.NET: The UnitsNet library gives you everything you need for working with quantities and units.

Numeral systems localization

Numeral systems serve as the foundational structures that determine how we represent numbers.

While the Western or Hindu-Arabic numeral system (which consists of the well-known 0-9 digits) is globally recognized, it may vary from your target country’s local numeral system.

Another factor to consider when expressing numeric data is the writing direction. For instance, Western numbers typically proceed from left to right. In contrast, Arabic and Persian numerals are scripted from right to left.

Culture/language Numeral presentation Writing direction
Western 123 Left-to-right
Arabic ١٢٣ Right-to-left
Hindi १२३ Left-to-right
Bengali ১২৩ Left-to-right
Chinese 一二三 Left-to-right
Thai ๑๒๓ Left-to-right
Persian ۱۲۳ Right-to-left
Tamil ௧௨௩ Left-to-right
Japanese 0, 1, 2, 3 (Western Arabic numerals are commonly used but native Kanji numerals also exist) Left-to-right

How to localize:

  • Ensure your platform or website can accommodate both left-to-right and right-to-left languages.

  • Enable users to customize their preferred numeral system via platform settings.

  • Use system locale data to auto-format numbers in alignment with user settings, ensuring numbers are always displayed in a format they're familiar with.

  • Opt for fonts that natively support the numeral system relevant to your audience. Without the right font, numbers may be displayed incorrectly or not at all.

  • Collaborate with native speakers for thorough testing to ensure that numbers are displayed accurately and in a culturally respectful manner.

  • Use specific libraries that help in numeral system conversions.

Pro tip: Use Centus - professional localization platform that can seamlessly integrate with your technologies, evolving with your needs and ensuring a smooth localization workflow. Learn more.

Get the week's best content!

By subscribing, you are agreeing to have your personal information managed in accordance with the terms of Centus’s Privacy Policy ->