Edit this page

Number Parsing

Kendo UI exposes methods which convert the specified string to a Number object by using the culture-specific settings.

Settings

Parse As Whole Number

The kendo.parseInt(string, [culture]) method converts a string to a whole number using the specified culture (current culture by default).

Example
//assumes that current culture defines decimal separator as "."
kendo.parseInt("12.22"); //12

//assumes that current culture defines decimal separator as "."
kendo.parseInt("1000 %") //10

//assumes that current culture defines decimal separator as ",", group separator as "." and currency symbol as "€"
kendo.parseInt("1.212,22 €"); //1212

Parse As Floating Point Number

The kendo.parseFloat(string, [culture]) method converts a string to a number with floating point using the specified culture (current culture by default).

Example
//assumes that current culture defines decimal separator as "."
kendo.parseFloat("12.22"); //12.22

//assumes that current culture defines decimal separator as "."
kendo.parseFloat("10.22 %") //0.1022

//assumes that current culture defines decimal separator as ",", group separator as "." and currency symbol as "€"
kendo.parseFloat("1.212,22 €"); //1212.22

See Also

Articles on globalization in Kendo UI:

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy