Java Code Examples for org.apache.commons.lang3.math.NumberUtils#createFloat()

The following examples show how to use org.apache.commons.lang3.math.NumberUtils#createFloat() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Validator.java    From cs-actions with Apache License 2.0 5 votes vote down vote up
public static boolean isValidFloat(@Nullable String floatStr) {
    if (StringUtils.isBlank(floatStr)) {
        return false;
    } else {
        String stripedInteger = StringUtils.strip(floatStr);

        try {
            NumberUtils.createFloat(stripedInteger);
            return true;
        } catch (NumberFormatException var3) {
            return false;
        }
    }
}
 
Example 2
Source File: HgMaterial.java    From gocd with Apache License 2.0 4 votes vote down vote up
boolean isVersionOneDotZeroOrHigher(String hgout) {
    String hgVersion = parseHgVersion(hgout);
    Float aFloat = NumberUtils.createFloat(hgVersion.subSequence(0, 3).toString());
    return aFloat >= 1;
}