Hello, i want to search using the built-in grid search toolbar.
When the first character is a ‘0’ (zero), he is automatically deleted as soon as I run the search.
How can I prevent this behaviour?
Hi Frederic,
Greetings from Syncfusion support,
We understand that when using the built-in grid search toolbar, entering a number with a leading zero (e.g., "06.1") results in the zero being automatically removed, displaying "6.1" instead.
This behavior occurs because JavaScript interprets numeric inputs in a standardized format. Specifically:
This is a default behavior in JavaScript, where numbers are stored in a way that does not retain leading zeros.
If you need further assistance, feel free to let us know!
Regards,
Joseph I.
yes i need further assistance because, as I asked before, my goal is that the leading zero should not be automatically deleted and your answer doesn't help me at all.
“This behavior occurs because JavaScript interprets numeric inputs in a standardized format” it's quite incomprehensible because the search input can receive any type of character string (numbers or other) and I've never had this behavior in any other component like a classic text-box...
Hi Frederic,
We have confirmed that the reported scenario is an issue from our side and logged as "Zero gets trimmed when searching decimal value”. Will include the defect fix in our upcoming patch release which will be rolled out on April 01, 2025. Until then we appreciate your patience.
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.
Feedback: https://www.syncfusion.com/feedback/66218/zero-gets-trimmed-when-searching-decimal-value
Disclaimer: "Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization".
Regards,
Kishore Muthukrishnan
Hi Frederic,
We are glad to announce that we have included the fix for the issue “Zero gets trimmed when searching decimal value” in our 29.1.35 release. So please upgrade to our latest version of the Syncfusion package to resolve the reported issue.
Root Cause: The issue occurs because the parseFloat function is used to process the number value. Since parseFloat automatically trims leading zeros in decimal numbers, any leading zero before the decimal point gets removed.
Solution: To resolve this issue, we avoid using parseFloat when the search value starts with a zero, preserving the original input format.
Sample Link : https://stackblitz.com/edit/angular-poxazo7u?file=src%2Fapp.component.ts
Feedback: https://www.syncfusion.com/feedback/66218/zero-gets-trimmed-when-searching-decimal-value
We thank you for your support and appreciate your patience in waiting for this release. Please get back to us if you need any further assistance.
Regards,
Kishore Muthukrishnan