I want to format the text sent to a edittext box so that at most 2 decimal places are shown, e.g. XXX.00. From the developer.android site I’ve been able to create the format variable (or is it a enum?) as follows:
NumberFormat nf = new NumberFormat;
nf.setMaximumFractionDigits(2);
I tried to format my string s = nf.format(s); but it doesn’t work.
How do I format a string vaiable with the nf to prepare it for a edittext box?
Also, how am I supposed to figure this out from the developers.android site for “NumberFormat”? Is there a way to read the site to figure this out, or is the site simply incomplete?
Try this. Your code looks incomplete. The NumberFormat documentation looks complete to me.