DecimalFormat df = new DecimalFormat("0000");
df.format(77);
#OUTPUT: 0077
DecimalFormat df = new DecimalFormat("####");
df.format(77);
#OUTPUT: 77
DecimalFormat df = new DecimalFormat("####%");
df.format(77);
#OUTPUT: 77%
DecimalFormat df = new DecimalFormat("'AA'####%");
df.format(77);
#OUTPUT: AA77%
DecimalFormat df = new DecimalFormat("\u00A5###,###");
df.format(7777);
#OUTPUT: \7,777
1 comment:
Good for people to know.
Post a Comment