public final class NumberUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String[] |
MONTH
Constants for month names.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
currencyFormat(double value,
char delimiter) |
static String |
format(double value,
int integral,
int fraction,
char delimiter) |
static double |
fractionRound(double value,
int fraction) |
static String |
getCurrencyValue(double aValue)
Returns rounded value as currency value (2 digits precision).
|
static String |
getCurrencyValue(float aValue) |
static String |
getDateString(int day,
int month,
int year)
Returns a short date string in form of "YY.MM.DD" or "YYYY.MM.DD" depending on the year parameter.
|
static String |
getDotedNumber(long number)
Returns a string representation of the parameter in which each three digit part of the number is separated by a '.'.
|
static String |
getDotedNumber(long number,
char separatorChar) |
static String |
getDotedNumber(long number,
Locale locale) |
static String |
getDotedNumberDE(long number) |
static String |
getDotedNumberUS(long number) |
static String |
itoa(int i)
Calls itoa(i,2);
|
static String |
itoa(int i,
int limit)
Converts an integer number in a String with given number of chars;
fills in zeros if needed from the left side.
|
static boolean |
luhnCheckNumber(String aNumber)
Returns true if the number parameter can pass a luhn check.
|
static String |
makeDateString(long time)
Often needed by different packages
Return a time string in form of DD MMM YY (23 FEB 02).
|
static String |
makeDateStringLong(long time)
Often needed by different packages
Return a time string in form of DD MMM YYYY (23 FEB 2002).
|
static String |
makeDigitalDateString(long time)
Returns a digital time string (23.02.2002).
|
static String |
makeDigitalDateStringLong(long time) |
static String |
makeISO8601DateString()
Returns the ISO8601 date of now.
|
static String |
makeISO8601DateString(long millis)
Returns the ISO8601 confirmant date string for the given time.
|
static String |
makeISO8601TimestampString()
Returns the ISO8601 timestamp of now.
|
static String |
makeISO8601TimestampString(long millis)
Creates an ISO8601 confirm timestamp string in form of YYYY-MM-DDTHH:MM:SS,zzz.
|
static String |
makeSizeString(long size)
Returns the given size in bytes as short string (Kb, Mb, B)...
|
static String |
makeTimeString(long time)
Often needed by different packages
Return a time string in form of hh:mm.
|
static String |
makeTimeString12H(long time)
Often needed by different packages
Return a time string in form of hh:mm am/pm.
|
static long |
parseDateString(String str) |
public static final String[] MONTH
public static String itoa(int i, int limit)
public static String itoa(int i)
public static String makeDateStringLong(long time)
public static String makeDateString(long time)
public static String makeDigitalDateString(long time)
time - public static String makeDigitalDateStringLong(long time)
public static String makeTimeString(long time)
public static String makeTimeString12H(long time)
public static String makeSizeString(long size)
size - the size in bytespublic static String getDateString(int day, int month, int year)
day - day parameter.month - month parameter.year - year parameter.public static String makeISO8601DateString(long millis)
millis - the time in millis since 01.01.1970.public static String makeISO8601DateString()
public static String makeISO8601TimestampString()
public static String makeISO8601TimestampString(long millis)
millis - time in millis.public static long parseDateString(String str)
public static String getCurrencyValue(float aValue)
public static String getCurrencyValue(double aValue)
aValue - the value to convert.public static boolean luhnCheckNumber(String aNumber)
aNumber - the number to check.for details on luhn algorithm.public static String getDotedNumber(long number)
number - the number to transform.public static String getDotedNumber(long number, char separatorChar)
public static String getDotedNumberUS(long number)
public static String getDotedNumberDE(long number)
public static double fractionRound(double value,
int fraction)
public static String format(double value, int integral, int fraction, char delimiter)
public static String currencyFormat(double value, char delimiter)
Copyright © 2010-2014 anotheria.net. All Rights Reserved.