parseInt

Parses as a string as an integer.

Example

<script src="https://kendo.cdn.telerik.com/2024.1.319/js/cultures/kendo.culture.de-DE.min.js"></script>
<script>
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.parseInt("12.22")); // outputs "12"
  kendo.culture("de-DE");
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(kendo.parseInt("1.212,22 €")); // outputs 1212
/* The result can be observed in the DevTools(F12) console of the browser. */
  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