Apache OpenOffice (AOO) Bugzilla – Issue 59335
BATHTEXT() function is wrong when value is more than 1000000
Last modified: 2013-08-07 15:13:18 UTC
=bathtext(1000001) will be displayed หนี่งล้านบาทถ้วน (one million bath). =bathtext(1000002) will be displayed หนึ่งสà¸à¸‡à¸¥à¹‰à¸²à¸™à¸šà¸²à¸—ถ้วน (one two million bath). I test value less than 1000000 and they seem to be OK. If I test value more than 1000000 then they seem to be wrong.
Created attachment 32380 [details] Bathtext
Hi Daniel, seems to be yours. Frank
fixed in src680/dr43 (OOo 2.0.2)
The fix only fixes half the problem (the misplacement of the "million" word). There's still an off-by-one problem. BAHTTEXT(1000001) gives the same result as BAHTTEXT(1000000); in general for n > 1000000, BAHTTEXT(n) is giving a string representation of n - 1. It's a rounding problem in the code. For example, for the case of 10000001, the existing code does in effect floor((1000001.0/1000000.0 - 1.0)*1000000.0) which gives a value of 0 rather than 1, because 1000001.0/1000000.0 gives a value very slightly less than 1.000001.
Created attachment 32884 [details] Patch relative to dr's patch
Created attachment 32885 [details] Patch relative to 2.0.1
indeed, sigh...
fixed again
Created attachment 32965 [details] Test document
back to QA Please use the attached document i59335_bahttext.xls to verify this issue.
set owner
fixed
verified in internal build cws_dr43
closed because fix available in OOo2.0.2m156