01: /*
02: * This software is released under a licence similar to the Apache Software Licence.
03: * See org.logicalcobwebs.proxool.package.html for details.
04: * The latest version is available at http://proxool.sourceforge.net
05: */
06: package org.logicalcobwebs.proxool;
07:
08: import java.text.DecimalFormat;
09:
10: /**
11: * Formats things as Strings
12: *
13: * @version $Revision: 1.1 $, $Date: 2003/03/05 18:42:33 $
14: * @author bill
15: * @author $Author: billhorsman $ (current maintainer)
16: * @since Proxool 0.8
17: */
18: public class FormatHelper {
19:
20: private static DecimalFormat smallNumberFormat = new DecimalFormat(
21: "00");
22:
23: private static DecimalFormat mediumNumberFormat = new DecimalFormat(
24: "0000");
25:
26: private static DecimalFormat bigCountFormat = new DecimalFormat(
27: "###000000");
28:
29: /**
30: * Format like 00
31: * @param value to format
32: * @return formatted value
33: */
34: public static String formatSmallNumber(long value) {
35: return smallNumberFormat.format(value);
36: }
37:
38: /**
39: * Format like 0000
40: * @param value to format
41: * @return formatted value
42: */
43: public static String formatMediumNumber(long value) {
44: return mediumNumberFormat.format(value);
45: }
46:
47: /**
48: * Format like ###000000
49: * @param value to format
50: * @return formatted value
51: */
52: public static String formatBigNumber(long value) {
53: return bigCountFormat.format(value);
54: }
55: }
56:
57: /*
58: Revision history:
59: $Log: FormatHelper.java,v $
60: Revision 1.1 2003/03/05 18:42:33 billhorsman
61: big refactor of prototyping and house keeping to
62: drastically reduce the number of threads when using
63: many pools
64:
65: */
|