00001 package gov.nasa.arc.ase.util;
00002
00003 public class Comma {
00004
00005
00006
00007
00008 private static final long thousand = 1000;
00009
00010 public static String format(long number) {
00011 StringBuffer value = new StringBuffer();
00012
00013 while(number >= thousand) {
00014 long t = number % thousand;
00015 number /= thousand;
00016
00017 value.insert(0, t);
00018 if(t < 10) value.insert(0, '0');
00019 if(t < 100) value.insert(0, '0');
00020 value.insert(0, ',');
00021 }
00022 value.insert(0, number);
00023
00024 return value.toString();
00025 }
00026 }