Java tutorial
//package com.java2s; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Locale; public class Main { public static String convertToCurrency(float value) { DecimalFormat format = new DecimalFormat("#.##"); try { value = Float.parseFloat(format.format(value)); } catch (Exception e) { e.printStackTrace(); } NumberFormat defaultFormat = NumberFormat.getCurrencyInstance(Locale.CANADA); return defaultFormat.format(value); } }