| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
SFormat
is a utility class for formatting numbers as
strings. It has methods for formatting int
s and
double
s, justified in various ways.
Method Summary | |
static String | sprint(int r, double d) Stringifies a decimal with r decimal places to the right of the point, in a field fitted to the number. |
static String | sprint(double d) Stringifies a decimal with 2 decimal places to the right of the point, in a field fitted to the number (as for currency). |
static String | sprintc(int w, int i) Stringifies an integer centered in a field of width w. |
static String | sprintc(int w, int r, double d) Stringifies a decimal with r decimal places to the right of the point, centered in a field of width w. |
static String | sprintc(int w, String str) Centers a string in a field of width w. |
static String | sprintr(int w, int i) Stringifies an integer right-justified in a field of width w. |
static String | sprintr(int w, String str) Right-justifies a String in a field of width w. |
static String | sprintr(int w, int r, double d) Stringifies a decimal with r decimal places to the right of the point, right-justified in a field of width w. |
static String | sprintzr(int w, int i) Stringifies an integer in a field of width w, right-justified and zero-filled. |
Method Detail |
public static String sprint(int r, double d)
double
to stringify.public static String sprint(double d)
double
to stringify.public static String sprintc(int w, int i)
int
to stringify.public static String sprintc(int w, int r, double d)
double
to stringify.public static String sprintc(int w, String str)
String
to center.public static String sprintr(int w, int i)
int
to stringify.public static String sprintr(int w, String str)
String
to justify.public static String sprintr(int w, int r, double d)
double
to stringify.public static String sprintzr(int w, int i)
int
to stringify.Association Links |
to Class java.lang.String
to Class java.lang.String
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |