parseFloat
Parses a string as a floating point number.
Example
<script src="https://kendo.cdn.telerik.com/2024.4.1112/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.parseFloat("12.22")); // outputs "12.22"
kendo.culture("de-DE");
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(kendo.parseFloat("1.212,22 €")); // outputs "1212.22"
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(kendo.parseFloat("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 a Number
.
culture String
(optional)
The culture used to parse the number. The current culture is used by default.