Java Reference
In-Depth Information
Chapter 24 ) . The localized numeric conversions are the integer decim-
al conversion ( d ) and the three main floating-point conversions ( e , f , g
and their uppercase counterparts). For these conversions, digit charac-
ters are taken from the active locale, and the correct sign characters,
decimal point character, and grouping character (for the , flag) are also
taken from the locale. Similarly, if zero-padding is requested the zero
character is that defined by the locale. The NumberFormat class described
in Chapter 24 , on page 710 , provides more extensive formatting capab-
ilities for localized numbers.
Exercise 22.1 : Write a method that takes an array of floating-point
values and a number indicating how many columns to use, and prints
the array contents. Try to ensure that the entries in each column line up
neatly. Assume a line is 80 characters wide.
 
Search WWH ::




Custom Search