I need to format the number.
I need the following result:
3434 -> 3 434
3434.34 -> 3 434.34
3434.3 -> 3 434.30
Here is my code:
val formatter = DecimalFormat("#,###,##0.##")
return formatter.format(value)
But I get a result like this:
3434 -> 3 434
3434.34 -> 3 434.34
3434.3 -> 3 434.3 // wrong!! expected 3 434.30
I need to add zero at the end if there is one digit after the decimal point.
Please help me how I can fix the problem?