Converts data to type Number.

@method DataSourceBase.parseNumber
@param oData {String | Number | Boolean} Data to convert. Note, the following
values return as null: null, undefined, NaN, "".
@return {Number} A number, or null.
@static
482441
function(oData) {
    if(!lang.isValue(oData) || (oData === "")) {
        return null;
    }

    //Convert to number
    var number = oData * 1;
    
    // Validate
    if(lang.isNumber(number)) {
        return number;
    }
    else {
        YAHOO.log("Could not convert data " + lang.dump(oData) + " to type Number", "warn", this.toString());
        return null;
    }
}
748160
function /*11.1.1.1 */$$core$$InitializeNumberFormat (numberFormat, locales, options) {
        var
        // This will be a internal properties object if we're not already initialized
            internal = $$core$$getInternalProperties(numberFormat),

        // Create an object whose props can be used to restore the values of RegExp props
            regexpState = $$core$$createRegExpRestore();

        // 1. If numberFormat has an [[initializedIntlObject]] internal property with
        // value true, throw a TypeError exception.
        if (internal['[[initializedIntlObject]]'] === true)
            throw new TypeError('`this` object has already been initialized as an Intl object');

        // Need this to access the `internal` object
        $$core$$defineProperty(numberFormat, '__getInternalProperties', {
            value: function () {
                // NOTE: Non-standard, for internal use only
                if (arguments[0] === $$core$$secret)
                    return internal;
            }
        });

        // 2. Set the [[initializedIntlObject]] internal property of numberFormat to true.
        internal['[[initializedIntlObject]]'] = true;

        var
        // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList
        //    abstract operation (defined in 9.2.1) with argument locales.
            requestedLocales = $$core$$CanonicalizeLocaleList(locales);

        // 4. If options is undefined, then
        if (options === undefined)
            // a. Let options be the result of creating a new object as if by the
            // expression new Object() where Object is the standard built-in constructor
            // with that name.
            options = {};

        // 5. Else
        else
            // a. Let options be ToObject(options).
            options = $$core$$toObject(options);

        var
        // 6. Let opt be a new Record.
            opt = new $$core$$Record(),

        // 7. Let matcher be the result of calling the GetOption abstract operation
        //    (defined in 9.2.9) with the arguments options, "localeMatcher", "string",
        //    a List containing the two String values "lookup" and "best fit", and
        //    "best fit".
            matcher =  $$core$$GetOption(options, 'localeMatcher', 'string', new $$core$$List('lookup', 'best fit'), 'best fit');

        // 8. Set opt.[[localeMatcher]] to matcher.
        opt['[[localeMatcher]]'] = matcher;

        var
        // 9. Let NumberFormat be the standard built-in object that is the initial value
        //    of Intl.NumberFormat.
        // 10. Let localeData be the value of the [[localeData]] internal property of
        //     NumberFormat.
            localeData = $$core$$internals.NumberFormat['[[localeData]]'],

        // 11. Let r be the result of calling the ResolveLocale abstract operation
        //     (defined in 9.2.5) with the [[availableLocales]] internal property of
        //     NumberFormat, requestedLocales, opt, the [[relevantExtensionKeys]]
        //     internal property of NumberFormat, and localeData.
            r = $$core$$ResolveLocale(
                    $$core$$internals.NumberFormat['[[availableLocales]]'], requestedLocales,
                    opt, $$core$$internals.NumberFormat['[[relevantExtensionKeys]]'], localeData
                );

        // 12. Set the [[locale]] internal property of numberFormat to the value of
        //     r.[[locale]].
        internal['[[locale]]'] = r['[[locale]]'];

        // 13. Set the [[numberingSystem]] internal property of numberFormat to the value
        //     of r.[[nu]].
        internal['[[numberingSystem]]'] = r['[[nu]]'];

        // The specification doesn't tell us to do this, but it's helpful later on
        internal['[[dataLocale]]'] = r['[[dataLocale]]'];

        var
        // 14. Let dataLocale be the value of r.[[dataLocale]].
            dataLocale = r['[[dataLocale]]'],

        // 15. Let s be the result of calling the GetOption abstract operation with the
        //     arguments options, "style", "string", a List containing the three String
        //     values "decimal", "percent", and "currency", and "decimal".
            s = $$core$$GetOption(options, 'style', 'string', new $$core$$List('decimal', 'percent', 'currency'), 'decimal');

        // 16. Set the [[style]] internal property of numberFormat to s.
        internal['[[style]]'] = s;

        var
        // 17. Let c be the result of calling the GetOption abstract operation with the
        //     arguments options, "currency", "string", undefined, and undefined.
            c = $$core$$GetOption(options, 'currency', 'string');

        // 18. If c is not undefined and the result of calling the
        //     IsWellFormedCurrencyCode abstract operation (defined in 6.3.1) with
        //     argument c is false, then throw a RangeError exception.
        if (c !== undefined && !$$core$$IsWellFormedCurrencyCode(c))
            throw new RangeError("'" + c + "' is not a valid currency code");

        // 19. If s is "currency" and c is undefined, throw a TypeError exception.
        if (s === 'currency' && c === undefined)
            throw new TypeError('Currency code is required when style is currency');

        // 20. If s is "currency", then
        if (s === 'currency') {
            // a. Let c be the result of converting c to upper case as specified in 6.1.
            c = c.toUpperCase();

            // b. Set the [[currency]] internal property of numberFormat to c.
            internal['[[currency]]'] = c;

            var
            // c. Let cDigits be the result of calling the CurrencyDigits abstract
            //    operation (defined below) with argument c.
                cDigits = $$core$$CurrencyDigits(c);
        }

        var
        // 21. Let cd be the result of calling the GetOption abstract operation with the
        //     arguments options, "currencyDisplay", "string", a List containing the
        //     three String values "code", "symbol", and "name", and "symbol".
            cd = $$core$$GetOption(options, 'currencyDisplay', 'string', new $$core$$List('code', 'symbol', 'name'), 'symbol');

        // 22. If s is "currency", then set the [[currencyDisplay]] internal property of
        //     numberFormat to cd.
        if (s === 'currency')
            internal['[[currencyDisplay]]'] = cd;

        var
        // 23. Let mnid be the result of calling the GetNumberOption abstract operation
        //     (defined in 9.2.10) with arguments options, "minimumIntegerDigits", 1, 21,
        //     and 1.
            mnid = $$core$$GetNumberOption(options, 'minimumIntegerDigits', 1, 21, 1);

        // 24. Set the [[minimumIntegerDigits]] internal property of numberFormat to mnid.
        internal['[[minimumIntegerDigits]]'] = mnid;

        var
        // 25. If s is "currency", then let mnfdDefault be cDigits; else let mnfdDefault
        //     be 0.
            mnfdDefault = s === 'currency' ? cDigits : 0,

        // 26. Let mnfd be the result of calling the GetNumberOption abstract operation
        //     with arguments options, "minimumFractionDigits", 0, 20, and mnfdDefault.
            mnfd = $$core$$GetNumberOption(options, 'minimumFractionDigits', 0, 20, mnfdDefault);

        // 27. Set the [[minimumFractionDigits]] internal property of numberFormat to mnfd.
        internal['[[minimumFractionDigits]]'] = mnfd;

        var
        // 28. If s is "currency", then let mxfdDefault be max(mnfd, cDigits); else if s
        //     is "percent", then let mxfdDefault be max(mnfd, 0); else let mxfdDefault
        //     be max(mnfd, 3).
            mxfdDefault = s === 'currency' ? Math.max(mnfd, cDigits)
                        : (s === 'percent' ? Math.max(mnfd, 0) : Math.max(mnfd, 3)),

        // 29. Let mxfd be the result of calling the GetNumberOption abstract operation
        //     with arguments options, "maximumFractionDigits", mnfd, 20, and mxfdDefault.
            mxfd = $$core$$GetNumberOption(options, 'maximumFractionDigits', mnfd, 20, mxfdDefault);

        // 30. Set the [[maximumFractionDigits]] internal property of numberFormat to mxfd.
        internal['[[maximumFractionDigits]]'] = mxfd;

        var
        // 31. Let mnsd be the result of calling the [[Get]] internal method of options
        //     with argument "minimumSignificantDigits".
            mnsd = options.minimumSignificantDigits,

        // 32. Let mxsd be the result of calling the [[Get]] internal method of options
        //     with argument "maximumSignificantDigits".
            mxsd = options.maximumSignificantDigits;

        // 33. If mnsd is not undefined or mxsd is not undefined, then:
        if (mnsd !== undefined || mxsd !== undefined) {
            // a. Let mnsd be the result of calling the GetNumberOption abstract
            //    operation with arguments options, "minimumSignificantDigits", 1, 21,
            //    and 1.
            mnsd = $$core$$GetNumberOption(options, 'minimumSignificantDigits', 1, 21, 1);

            // b. Let mxsd be the result of calling the GetNumberOption abstract
            //     operation with arguments options, "maximumSignificantDigits", mnsd,
            //     21, and 21.
            mxsd = $$core$$GetNumberOption(options, 'maximumSignificantDigits', mnsd, 21, 21);

            // c. Set the [[minimumSignificantDigits]] internal property of numberFormat
            //    to mnsd, and the [[maximumSignificantDigits]] internal property of
            //    numberFormat to mxsd.
            internal['[[minimumSignificantDigits]]'] = mnsd;
            internal['[[maximumSignificantDigits]]'] = mxsd;
        }
        var
        // 34. Let g be the result of calling the GetOption abstract operation with the
        //     arguments options, "useGrouping", "boolean", undefined, and true.
            g = $$core$$GetOption(options, 'useGrouping', 'boolean', undefined, true);

        // 35. Set the [[useGrouping]] internal property of numberFormat to g.
        internal['[[useGrouping]]'] = g;

        var
        // 36. Let dataLocaleData be the result of calling the [[Get]] internal method of
        //     localeData with argument dataLocale.
            dataLocaleData = localeData[dataLocale],

        // 37. Let patterns be the result of calling the [[Get]] internal method of
        //     dataLocaleData with argument "patterns".
            patterns = dataLocaleData.patterns;

        // 38. Assert: patterns is an object (see 11.2.3)

        var
        // 39. Let stylePatterns be the result of calling the [[Get]] internal method of
        //     patterns with argument s.
            stylePatterns = patterns[s];

        // 40. Set the [[positivePattern]] internal property of numberFormat to the
        //     result of calling the [[Get]] internal method of stylePatterns with the
        //     argument "positivePattern".
        internal['[[positivePattern]]'] = stylePatterns.positivePattern;

        // 41. Set the [[negativePattern]] internal property of numberFormat to the
        //     result of calling the [[Get]] internal method of stylePatterns with the
        //     argument "negativePattern".
        internal['[[negativePattern]]'] = stylePatterns.negativePattern;

        // 42. Set the [[boundFormat]] internal property of numberFormat to undefined.
        internal['[[boundFormat]]'] = undefined;

        // 43. Set the [[initializedNumberFormat]] internal property of numberFormat to
        //     true.
        internal['[[initializedNumberFormat]]'] = true;

        // In ES3, we need to pre-bind the format() function
        if ($$core$$es3)
            numberFormat.format = $$core$$GetFormatNumber.call(numberFormat);

        // Restore the RegExp properties
        regexpState.exp.test(regexpState.input);

        // Return the newly initialised object
        return numberFormat;
    }
1148017
function N(a) {
    var t = typeof a;
    if (t === 'number') return a;
    if (t === 'undefined') return 0;
    if (t === 'null') return 0;
    try {
        var v = parseFloat(a);
        if (isNaN(v)) return 0;
        return v;
    }
    catch (e) {
        return 0;
    }
}
768995
function parseJSON(data) {
    var oData;
    try {
        oData = JSON.parse(data);
    } catch (e) {
        return false;
    }
    return oData;
}
1109726
function parseNumber (inp) {
    var res = "";
    if (inp.takeAPeek("-")) res += "-";
  
    var match = parseInteger(inp);
    if (match) res += match;
  
    match = parseFraction(inp);
    if (match) res += match;
  
    if (res && res !== "-") {
      match = parseExponent(inp);
      if (match) res += match;
    }
  
    if (res === "-") syntaxError(inp, "Expected number");
    return res || null;
  }
586275
function ParseInternationalNumber(number) {
    var ret;

    // Parse and strip the country code.
    var countryCode = ParseCountryCode(number);
    if (!countryCode)
      return null;
    number = number.substr(countryCode.length);

    // Lookup the meta data for the region (or regions) and if the rest of
    // the number parses for that region, return the parsed number.
    var entry = dataBase[countryCode];
    if (Array.isArray(entry)) {
      for (var n = 0; n < entry.length; ++n) {
        if (typeof entry[n] == "string")
          entry[n] = ParseMetaData(countryCode, entry[n]);
        if (n > 0)
          entry[n].formats = entry[0].formats;
        ret = ParseNationalNumber(number, entry[n])
        if (ret)
          return ret;
      }
      return null;
    }
    if (typeof entry == "string")
      entry = dataBase[countryCode] = ParseMetaData(countryCode, entry);
    return ParseNationalNumber(number, entry);
  }
1048713
function ParseNationalNumber(number, md) {
    if (!md.possiblePattern.test(number) ||
        !md.nationalPattern.test(number)) {
      return null;
    }
    // Success.
    return new NationalNumber(md, number);
  }
294638
function(rawValue) {
			// Null and undefined values first
			if (rawValue === null || typeof(rawValue) === 'undefined') {
				return NaN;
			}
			// isNaN(object) returns true, so make sure NaN is checking for a number; Discard Infinite values
			if (typeof(rawValue) === 'number' && !isFinite(rawValue)) {
				return NaN;
			}
			// If it is in fact an object, dive in one more level
			if (typeof(rawValue) === 'object') {
				if ((rawValue instanceof Date) || (rawValue.isValid)) {
					return rawValue;
				}
				return this.getRightValue(this.isHorizontal() ? rawValue.x : rawValue.y);
			}

			// Value is good, return it
			return rawValue;
		}
256905
function getData() {
  var o = {}, k, v;
  for(k in this._data) {
    v = this._data[k].v;
    // must coerce to strings here
    if(typeof v === 'number') {
      v = '' + v;
    }
    o[k] = v;
  }
  return o;
}
171873
private List<?> convertDataToList(final Object data) {
		if (data == null) {
			return null;
		} else if (data instanceof List) {
			return (List<?>) data;
		} else if (data instanceof Object[]) {
			return Arrays.asList((Object[]) data);
		} else {
			return Arrays.asList(new Object[]{data});
		}
	}
1283992
function getNumber() {
  const type = NodeType.NumberType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const l = tokens[pos].number_l;
  let content = '';

  for (let j = 0; j < l; j++) {
    content += tokens[pos + j].value;
  }

  pos += l;

  return newNode(type, content, line, column);
}
621850
function(a, v, r) {
    if (typeof a == 'object') {
      for (v in a)
        this.data(v, a[v])

    } else if (arguments.length < 2) {
      try {
        return JSON.parse(this.attr('data-' + a))
      } catch(e) {
        return this.attr('data-' + a)
      }

    } else {
      this.attr(
        'data-' + a
      , v === null ?
          null :
        r === true || typeof v === 'string' || typeof v === 'number' ?
          v :
          JSON.stringify(v)
      )
    }

    return this
  }
792685
public Object parseAs(Type dataType) throws IOException {
    if (!hasMessageBody()) {
      return null;
    }
    return request.getParser().parseAndClose(getContent(), getContentCharset(), dataType);
  }
242477
@SuppressWarnings("unchecked")
	public static <T> T parseNumber(String value, Class<T> targetClass){
		if(value == null){
			return null;
		}
		try{
			if(Integer.class == targetClass){
				return (T)Integer.valueOf(value);
			}
			else if(Float.class == targetClass){
				return (T)Float.valueOf(value);
			}
			else if(Double.class == targetClass){
				return (T)Double.valueOf(value);
			}
			else if(Byte.class == targetClass){
				return (T)Byte.valueOf(value);
			}
			else if(Short.class == targetClass){
				return (T)Short.valueOf(value);
			}
			else if(Long.class == targetClass){
				return (T)Long.valueOf(value);
			}
			else{
				return null;
			}
		}
		catch(NumberFormatException e){}
		return null;
	}
950214
function(data){
		return typeof data === 'object' 
			? JSON.stringify(data) 
			: (typeof data === 'string' || typeof data === 'number' ? String(data) : null);
	}
356499
function getType(value) {
        // inspired by http://techblog.badoo.com/blog/2013/11/01/type-checking-in-javascript/

        // handle null in old IE
        if (value === null) {
            return 'null';
        }

        // handle DOM elements
        if (value && (value.nodeType === 1 || value.nodeType === 9)) {
            return 'element';
        }

        var s = Object.prototype.toString.call(value);
        var type = s.match(/\[object (.*?)\]/)[1].toLowerCase();

        // handle NaN and Infinity
        if (type === 'number') {
            if (isNaN(value)) {
                return 'nan';
            }
            if (!isFinite(value)) {
                return 'infinity';
            }
        }

        return type;
    }
107709
private static String getJsonValueAsNumberString(JsonValue value) {
        return (value != null && value.getValueType() == ValueType.NUMBER) ? value.toString() : null;
    }