Java tutorial
//package com.java2s; public class Main { public static String getMoneyString(int value) { String returnValue = "" + value; StringBuilder builder = new StringBuilder(returnValue); if (returnValue.length() > 2) { builder.insert(builder.length() - 2, "."); builder.insert(0, "$"); } else { builder.insert(0, "$0."); } return builder.toString(); } }