Floating-point number reading incorrect #2849

Closed
opened 2023-01-12 11:13:57 +00:00 by zouxpgithub · 2 comments

For example, 22.225 is incorrectly read 22.224999999

For example, 22.225 is incorrectly read 22.224999999
Owner

Can you share an example file?

In general, the v values are the raw values coming from the workbook. If you want the formatted text, the w property holds the text values. Some of the API functions take a raw option to control whether raw or formatted values are used.

To show the effect, see the attached file. The value 22.225 was added to the sheet in 3 ways: manually entered, using the formula =22.225 and using the formula =22225/1000. In all three cases, under the hood Excel stores 22.225000000000001.

Can you share an example file? In general, the `v` values are the raw values coming from the workbook. If you want the formatted text, the `w` property holds the text values. Some of the API functions take a `raw` option to control whether raw or formatted values are used. To show the effect, see the attached file. The value 22.225 was added to the sheet in 3 ways: manually entered, using the formula `=22.225` and using the formula `=22225/1000`. In all three cases, under the hood Excel stores `22.225000000000001`.
Owner

Please share an example and we can reopen the issue and take a closer look. It is almost certainly the case that the actual file has a value like 22.224999999 and the number formatter library should be generating the correct text. (the formatted text and raw values are separate fields in the cell object)

Please share an example and we can reopen the issue and take a closer look. It is almost certainly the case that the actual file has a value like `22.224999999` and the number formatter library should be generating the correct text. (the formatted text and raw values are separate fields in the cell object)
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#2849
No description provided.