Here you can find the source of formatCsv(final Number number)
public static String formatCsv(final Number number)
//package com.java2s; //License from project: Apache License public class Main { public static String formatCsv(final Number number) { if (number == null) { return ""; }//from w w w . j a va 2s . com return formatCsv(number.longValue()); } public static String formatCsv(final Long number) { if (number == null) { return ""; } final String s = String.valueOf(number); final StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length(); i++) { if ((s.length() - i) % 3 == 0) { if (sb.length() > 0) { sb.append(","); } } sb.append(s.charAt(i)); } return sb.toString(); } }