SyntaxFix
Write A Post
Hire A Developer
Questions
I was looking for an answer to this question and later I developed a method! :) A fair warning, it's rounding up the value.
private float limitDigits(float number) { return Float.valueOf(String.format(Locale.getDefault(), "%.2f", number)); }