public final class NumberUtils extends Object
Modifier and Type | Method and Description |
---|---|
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
|
public static String fillWithZeros(String str, int tailleFinale)
str
- Chaine à modifiertailleFinale
- Longueure de la chaine une fois modifiéepublic static String fillWithZerosIfNoPercentCharFoundAndNotEmpty(String str, int tailleFinale)
str
- Chaine à modifiertailleFinale
- Longueure de la chaine une fois modifiéepublic static Float parseFloatOrNull(String value)
value
- the valuepublic static Long parseLongOrNull(String value)
value
- the valuepublic static Float round(Float a, int n)
a
- the an
- the npublic static String truncateAndAdd2Digits(Float a)
a
- Un nombre.public static boolean validateInt(String number)
number
- la stringpublic static boolean validateNumber(String number)
number
- le nombreCopyright © 2019 City of Paris. All rights reserved.