Rounding Numbers on Android

0

I am trying to format numbering to only two decimal places after the comma, I am using the following code line

NumberFormat formato = new DecimalFormat("0.00");

But the minimum API of my application is 15 and it's asking 24 to use this class, does anyone know of any other way to round and format numbering?

    
asked by anonymous 05.02.2017 / 03:18

1 answer

1

You are probably using the android.icu.text.NumberFormat class that is in API 24. Go to imports and switch to java.text.NumberFormat . The memo for DecimalFormat : java.text.DecimalFormat .

    
05.02.2017 / 03:36