[Bug 64620] New: Apache POI API evaluation value - Excel value - not matching

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 64620] New: Apache POI API evaluation value - Excel value - not matching

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64620

            Bug ID: 64620
           Summary: Apache POI API evaluation value - Excel value - not
                    matching
           Product: POI
           Version: 4.1.2-FINAL
          Hardware: PC
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: XSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

We have entered following formula in the excel

   =3000/12*(1-0.8)

The above formula will result to 50.


Evaluating this formula through Apache poi Java library resulting to 49.99999.

As our application runs on numbers, the out put results doesn't match to the
expected results.

Please comment.

Thanks!!

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64620] Apache POI API evaluation value - Excel value - not matching

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64620

--- Comment #1 from west wong <[hidden email]> ---


new BigDecimal(3000/12*(1-0.8)).setScale(0,RoundingMode.HALF_UP);

The value of newScale denpends on what you need !

I usually use setScale(2,RoundingMode.HALF_UP);

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]