|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.paris.lutece.plugins.stock.utils.NumberUtils
public final class NumberUtils
Provides utility methods for numbers
| Method Summary | |
|---|---|
static String |
fillWithZeros(String str,
int tailleFinale)
Ajouter des 0 à gauche jusqu'à ce que la taille de la chaine soit (au moins) de la taille spécifiée. |
static String |
fillWithZerosIfNoPercentCharFoundAndNotEmpty(String str,
int tailleFinale)
Applique le même comportement que fillWithZeros mais vérifie avant qu'aucun caractère '%' n'est présent dans la chaine et si la chaine n'est pas vide.. |
static Float |
parseFloatOrNull(String value)
Parses the float or return null if exception. |
static Long |
parseLongOrNull(String value)
Parses the long or null if exception. |
static Float |
round(Float a,
int n)
Round float. |
static String |
truncateAndAdd2Digits(Float a)
|
static String |
truncateAndAdd2Digits(String value)
|
static boolean |
validateInt(String number)
Retourne vrai si la string contient un entier |
static boolean |
validateNumber(String number)
Retourne vrai si la string contient un nombre |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String fillWithZeros(String str,
int tailleFinale)
str - Chaine à modifiertailleFinale - Longueure de la chaine une fois modifiée
public static String fillWithZerosIfNoPercentCharFoundAndNotEmpty(String str,
int tailleFinale)
str - Chaine à modifiertailleFinale - Longueure de la chaine une fois modifiée
public static Float parseFloatOrNull(String value)
value - the value
public static Long parseLongOrNull(String value)
value - the value
public static Float round(Float a,
int n)
a - the an - the n
public static String truncateAndAdd2Digits(Float a)
a - Un nombre.
public static boolean validateInt(String number)
number - la string
public static boolean validateNumber(String number)
number - le nombre
public static String truncateAndAdd2Digits(String value)
value - Valeur à formater.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||