23.07.2013 Views

Java IO.pdf - Nguyen Dang Binh

Java IO.pdf - Nguyen Dang Binh

Java IO.pdf - Nguyen Dang Binh

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Java</strong> I/O<br />

Table 16.3 lists the default patterns used by different locales' decimal formats. For the basic<br />

decimal format shown in columns 2 and 3, most of the locales use the same pattern as the U.S.<br />

English locale. The notable exceptions are the Arabic-speaking countries and Macedonia. The<br />

primary difference between locales comes in the decimal format symbols, not the pattern. The<br />

percent formats, (not shown) all round down to the nearest integer. With one exception, all<br />

locales share the percent format #,##0%. The one exception is the #,##0 used in the<br />

mainland China locale. This uses a per mille (per thousand), as opposed to the more common<br />

percent (per hundred).<br />

The currency formats, shown in columns 4 and 5, are a lot more interesting, because most<br />

countries have their own currencies with their own unique symbols. Even when countries<br />

share a symbol and a name for the currency, such as the dollar ($), it's still important to<br />

distinguish between Canadian, American, and Australian dollars. Many of the currencies in<br />

Table 16.3, especially for country-independent language locales, use the symbol, which<br />

refers to a currency of indeterminate type. The [RLM] you'll see in many of the Arabic<br />

formats stands for the non-printing Unicode character \u200f, the right-to-left marker, used<br />

to ensure proper directionality in the number in Arabic's right-to-left system. Hebrew is also a<br />

right-to-left script, but in modern Hebrew numbers are generally written in the European<br />

fashion from left to right.<br />

Table 16.3. Decimal Format Patterns<br />

Language (Country) Decimal Pattern Example:-<br />

1234.56<br />

Currency Pattern<br />

Example:<br />

1,234.56<br />

-<br />

Albanian #,##0.### -1.234,56 #,##0.00 - 1.234,56<br />

Albanian (Albania) #,##0.### -1.234,56 Lek#,##0.### -Lek1.234,56<br />

Arabic #,##0.### -1,234.56 #,##0.00 - 1,234.56<br />

Arabic (Algeria)<br />

Arabic (Bahrain)<br />

Arabic (Egypt)<br />

Arabic (Iraq)<br />

Arabic (Jordan)<br />

Arabic (Kuwait)<br />

Arabic (Lebanon)<br />

Arabic (Libyan Arab<br />

Jamahiriya)<br />

Arabic (Morocco)<br />

Arabic (Oman)<br />

Arabic (Qatar)<br />

#,##0.###; #,<br />

##0.###-<br />

#,##0.###;#,<br />

##0.###-<br />

#,##0.###;#,<br />

##0.###-<br />

#,##0.###;#,<br />

##0.###-<br />

#,##0.###;#,<br />

##0.###-<br />

#,##0.###;#,<br />

##0.###-<br />

#,##0.###;#,<br />

##0.###-<br />

#,##0.###;#,<br />

##0.###-<br />

#,##0.###;#,<br />

##0.###-<br />

#,##0.###;#,<br />

##0.###-<br />

#,##0.###;<br />

#,##0.###-<br />

1,234.56-<br />

1,234.56-<br />

1,234.56-<br />

1,234.56-<br />

.[RLM] #,##0.###;<br />

[RLM] #,##0.###-<br />

[RLM] #,##0.###;<br />

[RLM] #,##0.###-<br />

[RLM] #,##0.###;<br />

[RLM] #,##0.###-<br />

[RLM] #,##0.###;<br />

[RLM] #,##0.###-<br />

1,234.56- [RLM] #,##0.###;<br />

[RLM] #,##0.###-<br />

1,234.56-<br />

1,234.56-<br />

1,234.56-<br />

1,234.56-<br />

1,234.56-<br />

1,234.56-<br />

[RLM] #,##0.###;<br />

[RLM] #,##0.###-<br />

[RLM] #,##0.###;<br />

[RLM] #,##0.###-<br />

[RLM] #,##0.###;<br />

[RLM] #,##0.###-<br />

[RLM] #,##0.###;<br />

[RLM] #,##0.###-<br />

[RLM] #,##0.###;<br />

[RLM] #,##0.###-<br />

[RLM] #,##0.###;<br />

[RLM] #,##0.###-<br />

[RLM]<br />

1,234.56-<br />

[RLM]<br />

1,234.56-<br />

[RLM]<br />

1,234.56-<br />

[RLM]<br />

1,234.56-<br />

[RLM]<br />

1,234.56-<br />

[RLM]<br />

1,234.56-<br />

[RLM]<br />

1,234.56-<br />

[RLM]<br />

1,234.56-<br />

[RLM]<br />

1,234.56-<br />

[RLM]<br />

1,234.56-<br />

[RLM]<br />

1,234.56-<br />

418

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!