Globalization (6): digital format settings

Source: Internet
Author: User

Note the following when processing numeric values:

1. Characters Used as the delimiter for thousands of characters:

In the United States, the character is a comma (,). It is a period (.) in Germany (.). Therefore, one thousand and twenty-five is displayed1,025(In the United States) and1.025(In Germany ). In Sweden, the Delimiter is a space.

2. The character used as the decimal separator.
In the United States, the character is a period (.). In Germany, comma (,) is used (,). Therefore, 1,025.7 is displayed1,025.7(In the United States) and1.025, 7(In Germany ).

3. display of negative numbers.
You can place a negative sign at the beginning of a number or at the end of a number. In addition, numbers can be displayed in parentheses or even colors (such as red. Therefore, -527 can be displayed:

4. numbers or their shapes
Whether it is one-to-one correspondence with decimal numbers.
Of course, numbers may have different shapes in different regions. In addition, the numbers in some region settings may not be
Numbers used in the United States (0-9) are directly matched. (See Table 1)

Table 1:Numbers used in English (US), Arabic, and Japanese.

Note that Japanese has one more digit than Arabic or English (USA. It represents the number 10.

5. group numbers.
This indicates the number of digits between the separators in all numeric groups on the left of the decimal separator. For example, most regions use a combination of three numbers, for example, English (USA): 123,456,789.00. Note, however, that apart from a hundred-digit combination of three digits, the northern Indian language uses a combination of two digits: 12, 34, and 56,789.00.

6. percentage (%.
It can be written in many forms: 98%, 98%, 98 pct, and % 98. Therefore, you must not think that you can hard encode the percent number.

 

. NET standard numeric format:

Symbol

Description

Example

Output

C Currency String. Format("{0: C3}", 2) $2.000
D Decimal String. Format("{0: D3}", 2) 002
E Scientific notation 1.20E + 001 1.20E + 001
G General String. Format("{0: G}", 2) 2
N Number separated by semicolons String. Format("{0: N}", 250000) 250,000.00
X Hexadecimal String. Format("{0: X000}", 12) C
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.