I have a float number, let's say:
Float number = 2.667f;
String.format("%.1f", number)
will produce:
2,7
but in case of
Float number = 2.0f;
it will produce:
2,0
is it possible to instruct String.format
to avoid 0
after comma in case of integer numbers in order to receive for example 2
in the mentioned case.