Number Parsing

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

Parsing As Whole Numbers

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

// 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

Parsing As Floating Point Numbers

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

// 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

In this article
Not finding the help you need? Improve this article