public class NumberFormatter
extends java.lang.Object
| Constructor and Description |
|---|
NumberFormatter()
set up the defaults
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
formatDouble(double d)
returns a formatted double.
|
java.lang.String |
formatDouble(double d,
int precision)
returns a formatted double.
|
java.lang.String |
formatInt(int i,
int length)
returns a formatted integer with length digits
|
void |
setZapp0(boolean zapp0)
if set, remove trailing 0
|
public void setZapp0(boolean zapp0)
zapp0 - public java.lang.String formatInt(int i,
int length)
i - the integer to formatlength - total length of including leading zerospublic java.lang.String formatDouble(double d,
int precision)
d - the double to formatprecision - maximum precision, depending on value of zapp0, trailing 0s are discarded or keptpublic java.lang.String formatDouble(double d)
d - the double to format