src/main/java/com/teamunify/i18n/I.java
public static Number stringToNumber(String value, Number defaultValue) {
    if (value == null || value.isEmpty())
      return defaultValue;
    LanguageSetting s = languageProvider.vend();
    NumberFormat fmt = NumberFormat.getInstance(s.locale);
    try {
      value = value.replace(" ", "");
      return fmt.parse(value);
    } catch (ParseException e) {
      log.debug("Failed to parse number: " + value, e);
    }
    return defaultValue;
  }
/**
   * Parse the given locale-specific number, and return a Number object that represents the value.
   * <p/>
   * Use preferredNumberFormat() to get a help string that indicates the preferred input format for numbers.
   * <p/>
   * In general, this function is very tolerant of user input. Digit groupings are optional, but the fractional
   * separator must be correct.
   * <p/>
   * <pre>
   * // in en locale
   * I.stringToNumber(&quot;1,534,100.34&quot;, 0); // returns 1534100.34
   * I.stringToNumber(&quot;1534100.34&quot;, 0); // returns 1534100.34
   * // in fr locale
   * I.stringToNumber(&quot;1 534 100,34&quot;, 0); // returns 1534100.34
   * I.stringToNumber(&quot;1534100,34&quot;, 0); // returns 1534100.34
   * </pre>
   *
   * @param value        The string (e.g. 100.34) to be parsed
   * @param defaultValue The Number to return if the parsing fails.
   * @return A Number (e.g. rv.toDouble() == 100.34), or defaultValue if the string isn't understandable.
   */
Parse the given locale-specific number, and return a Number object that represents the value.

Use preferredNumberFormat() to get a help string that indicates the preferred input format for numbers.

In general, this function is very tolerant of user input. Digit groupings are optional, but the fractional
separator must be correct.

@param value        The string  to be parsed
@param defaultValue The Number to return if the parsing fails.
@return A Number  == 100.34), or defaultValue if the string isn't understandable.
Parse the given locale - specific number and return a Number object that represents the value . Use preferredNumberFormat () to get a help string that indicates the preferred input format for numbers . In general this function is very tolerant of user input . Digit groupings are optional but the fractional separator must be correct . @param value The string to be parsed @param defaultValue The Number to return if the parsing fails . @return A Number == 100 . 34 ) or defaultValue if the string isn ' t understandable .
public static Number stringToNumber(String value, Number defaultValue) {
    if (value == null || value.isEmpty())
      return defaultValue;
    LanguageSetting s = languageProvider.vend();
    NumberFormat fmt = NumberFormat.getInstance(s.locale);
    try {
      value = value.replace(" ", "");
      return fmt.parse(value);
    } catch (ParseException e) {
      log.debug("Failed to parse number: " + value, e);
    }
    return defaultValue;
  }
public static Number stringToNumber ( String value , Number defaultValue ) { if ( value == null || value . isEmpty ( ) ) return defaultValue ; LanguageSetting s = languageProvider . vend ( ) ; NumberFormat fmt = NumberFormat . getInstance ( s . locale ) ; try { value = value . replace ( " " , "" ) ; return fmt . parse ( value ) ; } catch ( ParseException e ) { log . debug ( "Failed to parse number: " + value , e ) ; } return defaultValue ; }
Parse the given locale-specific number, and return a Number object that represents the value.
Parse the given locale - specific number and return a Number object that represents the value .