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