Use the Java class java.text.DecimalFormat
to format the number. This is similar to COBOL pictures: # for an optional
digit, 0 for a required digit, “,” for a thousands separator, “.”
for the decimal point. Extra text before or after the number format is
included in the output.Note:
The thousands separator and decimal point are localized
to your locale.
|