incorrect output with '#,##0.00' format #2953
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2953
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SSF.format( "#,##0.00", 3.105 ) gives a result of '3.10' - it should be '3.11'.
It seems there is a bug in dec function.
Current version:
・get decimal part:
3.105 -> 0.104999998
・power the decimal part
Math.pow(0.1049998, 2) -> 10.49998
・round off powered decimal part
Math.floor(10.49998) -> 10
Shloud The logic be as below.
Math.pow(3.105,2) -> 310.5 -> Math.floor(310.5) -> 311 -> 311/100 -> 3.11
Thanks for reporting! There are a number of these cases that we need to investigate further.