Apache OpenOffice (AOO) Bugzilla – Issue 113628
ODFF: ODF 1.2 conformance: TRUNC() with negative, non-integer second argument
Last modified: 2013-01-29 21:52:17 UTC
Paragraph 6.17.9 of the latest OpenFormula draft http://lists.oasis-open.org/archives/tc-announce/201007/msg00004.html defines TRUNC(a;b) as: --- Truncate number a to the number of digits specified by b. If b is zero, or absent, truncate to a decimal integer. If b is positive, truncate to the specified number of decimal places. If b is negative, truncate to the left of the decimal point. If b is not an integer, it is truncated. --- According to the definition, one would have TRUNC(123.456;-1.2)=TRUNC(123.456;TRUNC(-1.2))=TRUNC(123.456;-1)=-120 while OpenOffice.org gives TRUNC(123.456;-1.2)=-100. It is unclear to me whether this is a bug in OOo or in the standard draft, so I reported this in my comments at http://lists.oasis-open.org/archives/office-comment/201008/msg00002.html
Note: The example results of -120 and -100 are wrong, they should be 120 and 100 instead. OOo's implementation is faulty, the correct result would be 120.
See also http://tools.oasis-open.org/issues/browse/OFFICE-3354