Format Float to n decimal places

You may also pass the float value, and use:

String.format("%.2f", floatValue);

Documentation

Leave a Comment