Java tutorial
//package com.java2s; import java.util.Locale; public class Main { public static String formatFloat(float t) { try { return String.format(Locale.US, "%.1f", t); } catch (Exception e) { e.printStackTrace(); } return "0.0"; } }