Closed mikez closed 6 months ago
The raw storage is D128 but that’s not always enough for some FP numbers.
cell.formatted_value
returns the value of the cell as it appears in Numbers as a str
. Part of the conversion is truncating the decimals to the maximum number of significant figures supported by numbers (15 digits).
Thank you. I don't understand the D128 encoding, but it sounds like it might be a floating point encoding. In that case, 15 digits sounds good knock on wood.
I noticed, if I store
55.80
in Numbers, thencell.value
becomes55.800000000000004
in numbers-parser.When is this rounding error introduced? Is it already in the IWA storage format itself or does it only occur later when creating Python floating points? If the latter, it might be nice to get out a
decimal.Decimal
orstr
or the like with the original IWA-value to prevent compounding rounding errors.