public class NumberFormatter
extends java.lang.Object
Constructor and Description |
---|
NumberFormatter() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
comma_grouped(int points)
Comma group a number and transform to a String (10123 => "10,123")
Should be used only after initializing NumberFormatter with Context.
|
static java.lang.String |
get_comma_grouped_number(android.content.Context context,
int points)
Comma group a number and transform to a String (10123 => "10,123")
|
static java.lang.String |
get_shortened_number(int points)
Turns a number into a shorthand form String of that number.
|
static NumberFormatter |
getInstance(android.content.Context context) |
int |
roundUp(int n) |
java.lang.String |
shorten_number(int points)
Turns a number into a shorthand form String of that number.
|
public static NumberFormatter getInstance(android.content.Context context)
public static java.lang.String get_shortened_number(int points)
points
- - the number to formatpublic java.lang.String shorten_number(int points)
points
- - the number to formatpublic java.lang.String comma_grouped(int points)
points
- - the number to formatpublic static java.lang.String get_comma_grouped_number(android.content.Context context, int points)
context
- - Activity or Application Context, must not be nullpoints
- - the number to formatpublic int roundUp(int n)