Here you can find the source of formatLongAsDecimal(long l)
public static String formatLongAsDecimal(long l)
//package com.java2s; //License from project: Artistic License public class Main { public static String formatLongAsDecimal(long l) { String rv = l + ""; if (rv.length() < 3) { while (rv.length() < 3) { rv = "0" + rv; }/*from ww w. ja v a 2 s . c o m*/ return "." + rv; } return rv.substring(0, rv.length() - 3) + "." + rv.substring(rv.length() - 3, rv.length()); } }