Do you want to round or display it as text?
Try looking up java.text.DecimalFormat if you want text.
-John Coryat
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To
I use, for better or worse,
public final static double roundDouble( double d, int places ) {
BigDecimal bd = new BigDecimal( Double.toString(d) );
bd = bd.setScale( places, BigDecimal.ROUND_HALF_UP);
return bd.doubleValue();
}
Pent
--
You received this message
Yeah, I use the NumberFormat:
NumberFormat numberFormat = DecimalFormat.getInstance();
numberFormat.setMaximumFractionDigits(2);
String formattedText = numberFormat.format(yourFloat);
On Aug 16, 11:13 am, Maps.Huge.Info (Maps API Guru)
cor...@gmail.com wrote:
Do you want to round or display it
3 matches
Mail list logo