Issue 113628 - ODFF: ODF 1.2 conformance: TRUNC() with negative, non-integer second argument
Summary: ODFF: ODF 1.2 conformance: TRUNC() with negative, non-integer second argument
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOO330m1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-03 22:26 UTC by Andrea Pescetti
Modified: 2013-01-29 21:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrea Pescetti 2010-08-03 22:26:00 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
Comment 1 ooo 2010-09-23 14:51:59 UTC
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.