Java tutorial
//package com.java2s; import android.text.TextUtils; public class Main { public static String formatDecimal(String dec) { if (TextUtils.isEmpty(dec)) { return ""; } Double d = Double.parseDouble(dec); return String.format("%.1f", d); } }