public final class UtilMethods extends Object
Modifier and Type | Method and Description |
---|---|
static String |
format(double d,
String format)
Used to format a double to a string.
|
static String |
format(long d,
String format)
Used to format a long to a string.
|
static String |
format(Number d,
String format)
Used to format a number to a string.
|
public static String format(double d, String format)
Used to format a double to a string.
Example:
double d = 1.222222 println d.format('0.00')
d
- The number to formatformat
- The formatpublic static String format(long d, String format)
Used to format a long to a string.
Example Usage:
long d = 1234567890L println d.format('0,000,000.00')
d
- The number to formatformat
- The formatCopyright © 2019. All rights reserved.