How do i round a BigDecimal to 2 decimal places and then to one significant figure?
Thanks
How do i round a BigDecimal to 2 decimal places and then to one significant figure?
Thanks
You can do something like this using a class in android DecimalFormat.
private String formatMagnitude(double magnitude)
{
DecimalFormat magnitudeFormat = new DecimalFormat("0.00");
return magnitudeFormat.format(magnitude);
}