Condividi tramite


Number.parseLocale Function

Creates a numeric value from a locale-specific string.

var numberVar = Number.parseLocale(value);

Arguments

  • value
    A string that represents a number.

Return Value

An object of type Number.

Exceptions

Exception type

Condition

Sys.ArgumentException

(Debug) value does not represent a number.

Remarks

Use the parseLocale function to create an object of type Number from a string. This function uses the Sys.CultureInfo.CurrentCulture property to determine the culture value.

To create a number from a locale-specific string by using the current culture, set the EnableScriptGlobalization property of the ScriptManager control to true. You must also modify the Web.config file to set the culture attribute of the globalization element to auto.

See Also

Reference

Number Type Extensions

Other Resources

Language Reference