Hi,
I’m encountering a formatting issue in Aspose.Cells GridJs.
When I enter a number using a comma as the decimal separator (e.g., 123456,7), the cell is incorrectly interpreted and formatted as a date. As a result, when I click the cell again, a calendar popup appears instead of treating it as a numeric value.
This seems to happen when entering values like 123456,7 into a cell — for example, cell B2.
Please note: this issue is regional format related, since in my locale the comma is used as the decimal separator.
I’ve attached a sample file where this behavior can be reproduced by simply typing 123456,7 into cell B2. error1.png (38,0 KB)
The issue you’re experiencing with Aspose.Cells GridJs interpreting numbers with a comma as a decimal separator as dates is likely due to the regional settings of your application. In some locales, a comma is used as a decimal separator, and when the input doesn’t match the expected format, it can lead to incorrect interpretations.
Solution
To resolve this, you can explicitly set the cell format to treat the input as a numeric value. This can be done by defining the cell’s format before entering the data. Here’s how you can do it:
Set the cell format to a numeric type that recognizes the comma as a decimal separator.
Ensure that the input method respects the regional settings.
Code
Here’s a sample code snippet to set the cell format:
// Assuming you have a reference to the GridJs instance
const grid = new GridJs({
// Your grid configuration
});
// Set the format for cell B2 to numeric
grid.setCellFormat('B2', {
type: 'number',
format: '#,##0.00' // Adjust the format as needed
});
// Now, when you enter a number like 123456,7, it should be treated correctly
Next Steps
Test the above code to see if it resolves the issue.
If the problem persists, check if there are any global settings in your application that might be overriding the cell format.
Consider updating the library to the latest version, as there may be fixes related to regional formatting issues.
Please implement these changes and let me know if you need further assistance!
I appreciate your help, but I believe this deserves to be investigated further as a default behavior issue, not just something that should be “worked around” manually.
@klep
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSGRIDJS-1804
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.