public class Number2String
extends java.lang.Object
Constructor and Description |
---|
Number2String() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
toDebugStr(double d)
Format a double to the specified format "#0.0000000#'.
|
static java.lang.String |
toFixLengthStr(double d,
java.lang.String pattern)
Format a double to the specified format pattern.
|
static java.lang.String |
toFixLengthStr(int length,
java.lang.String s)
Format a string to the specified length.
|
static java.lang.String |
toFixLengthStr(java.lang.String pattern,
int d)
Format a int to the specified format pattern.
|
static java.lang.String |
toStr(org.apache.commons.math3.complex.Complex c)
Format a complex number by using the default Num2Str.toStr(double) function in format (a + jb).
|
static java.lang.String |
toStr(org.apache.commons.math3.complex.Complex c,
java.lang.String format)
Format a complex number by using the default Num2Str.toStr(double) function in format (a + jb).
|
static java.lang.String |
toStr(double d)
Format a double to the specified format "#0.0000#'.
|
static java.lang.String |
toStr(double d,
java.lang.String pattern)
Format a double to the specified format pattern.
|
static java.lang.String |
toStr(java.lang.Double d,
java.lang.String pattern)
Format a double to the specified format pattern.
|
static java.lang.String |
toStr(int n)
Format an int number
|
static java.lang.String |
toStr(int length,
java.lang.String s)
Format a string to the specified length.
|
static java.lang.String |
toStr(long n)
Format a long number
|
static java.lang.String |
toStr(java.lang.String pattern,
double d)
Format a double to the specified format pattern.
|
static java.lang.String |
toStr(java.lang.String pattern,
int d)
Format a int to the specified format pattern.
|
public static java.lang.String toStr(int length, java.lang.String s)
length
- the length of the formatted string. white space will be patched at the begining
if length > 0 or at the end if length < 0s
- string to be formattedpublic static java.lang.String toStr(int n)
n
- number to be formattedpublic static java.lang.String toStr(long n)
n
- number to be formattedpublic static java.lang.String toFixLengthStr(java.lang.String pattern, int d)
pattern
- format patternd
- number to be formattedpublic static java.lang.String toStr(java.lang.String pattern, int d)
pattern
- format patternd
- number to be formattedpublic static java.lang.String toStr(double d)
d
- number to be formattedpublic static java.lang.String toDebugStr(double d)
d
- public static java.lang.String toStr(double d, java.lang.String pattern)
pattern
- format patternd
- number to be formattedpublic static java.lang.String toStr(java.lang.String pattern, double d)
pattern
- d
- public static java.lang.String toStr(java.lang.Double d, java.lang.String pattern)
d
- pattern
- public static java.lang.String toFixLengthStr(double d, java.lang.String pattern)
pattern
- format patternd
- number to be formattedpublic static java.lang.String toStr(org.apache.commons.math3.complex.Complex c)
c
- complex number to be formattedpublic static java.lang.String toStr(org.apache.commons.math3.complex.Complex c, java.lang.String format)
c
- format
- public static java.lang.String toFixLengthStr(int length, java.lang.String s)
length
- the length of the formatted string.s
- string to be formatted