parseInt

Parses as a string as an integer.

Example

<script src="https://kendo.cdn.telerik.com/2018.2.620/js/cultures/kendo.culture.de-DE.min.js"></script>
<script>
  console.log(kendo.parseInt("12.22")); // outputs "12"
  kendo.culture("de-DE");
  console.log(kendo.parseInt("1.212,22 €")); // outputs 1212
  console.log(kendo.parseInt("invalid")); // outputs "null"
</script>

Returns

Number the parsed number. Returns null if the value cannot be parsed as a valid Number.

Parameters

value String

The string which should be parsed as Number.

culture String (optional)

The culture used to parse the number. The current culture is used by default.

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