Java tutorial
//package com.java2s; import android.text.Html; public class Main { public static String getFormattedValue(float f, String s) { return Html.fromHtml(String.format("%s %.2f", new Object[] { s, Float.valueOf(f) })).toString(); } }