Unplanned
Last Updated: 25 Mar 2021 09:16 by ADMIN
Christiaan
Created on: 25 Mar 2021 09:13
Category: NumericTextBox
Type: Bug Report
1
kendo.parseFloat() method does not correctly parse culture-specific currency formats

Bug report

The kendo.parseFloat() method does not correctly parse negative currency strings in which the currency symbol is placed before the actual value i.e. "$ -5.00". 

Reproduction of the problem

1. Set the culture of the app to nl-NL (or another that formats the currency as $ -5.00)

2. Call the parseFloat method.

3. The value "null" is returned.

Dojo sample for reproduction https://dojo.telerik.com/AFOnaQIt

Current behavior

The kendo.parseFloat() method assumes that all negative currency values are in the format "-5.00 $". Since the format of the nl-NL culture has the format "$ -5.00, the if-clause that checks the position of the "-" fails, and the method returns null. 

Expected/desired behavior

Negative values with any currency format should be parsed correctly.

Environment

* **Kendo UI version:** 2021.1.224
* **jQuery version:** 1.12.4
* **Browser:** [all]

0 comments