Skip to main content

Software  > Globalization > Guidelines overview > Respect for culture and conventions > 

Globalize your On Demand Business

Calendar | Date & time | Time zone | Paper size | Cardinal number shape | Numeric value | Monetary amount | Mathematical | Measurement system | Sentence spacing & puncuation | First day of week | Address | Telephone format | Name | Government regulations | UI Language
Guideline C6-Allowing the Selection of Numeric Value Format

Numeric value formats are considered here separately from monetary amount formats, which may use different conventions.

Negative Numbers

Negative number representation does not have a universal form. Some countries use a leading hyphen to denote negative non-monetary numbers, some place the hyphen after the number, and some use another symbol altogether.

Example: The following list shows several ways to portray the number negative ten:

  • ¯10
  • -10
  • 10-
  • (10)
  • [10]
  • <10>

Decimal and Thousands Separators

Different regions of the world use different characters for the decimal and thousands separators. The term decimal separator is a misnomer, because many countries do not use the dot symbol as the decimal separator. The more correct term is the radix character.

Example: The following list shows some of the ways to present numeric values:

  • 1,234.56 .123
  • 1 234,56 0,123
  • 1.234,56

Guideline C6

Allow the user to select the numeric value format.

Example: The following Java program uses the NumberFormat class to present a given number in a culturally correct format:

import java.text.*;

import java.util.*;

public class GuidelineC6 extends Gudieline {

private static final String RESOURCE = "GuidelineC6";

private double number = 1234567.891;

public String getItRight() {

ResourceBundle bundle = ResourceBundle.getBundle

(RESOURCE, Sample.locale);

NumberFormat nf =

NumberFormat.getInstance(Sample.locale);

/* replace Sample.locale with Locale.US

to explicitly specify the English Locale

or with Locale.GERMANY

to explicitly specify the German Local

*/

return nf.format(number);

}

public String getResource() {

return RESOURCE;

}

}

Depending on the user's preference, the following results would be achieved:

User's Preference Result
USA -1,234,567.891000
Germany -1.234.567,891000
France -1 234 567,891000

We're here to help
Easy ways to get the answers you need.
E-mail IBM

Locate IBM globalized products

Product languages
Locate IBM globalized products

Relevant topics

Numbers