string to float format() method --float() code example Example: java string format .2f String.format("%.2f", 3.45);