Java tutorial
//package com.java2s; import java.text.DecimalFormat; public class Main { public static String[] userInfo; public static String formatCurr(float f) { DecimalFormat df = new DecimalFormat("#0.00"); int currSym = userInfo[5].charAt(0); if (userInfo[6].equals("false")) { return df.format(f) + "&#" + currSym + ";"; } else { return "&#" + currSym + ";" + df.format(f); } } }