You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2020/07/22 13:04:43 UTC

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

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: dev@poi.apache.org
          Reporter: avinash@seqnc.com
  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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


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

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64620

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |normal

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


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

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64620

--- Comment #1 from west wong <de...@foxmail.com> ---


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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


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

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64620

PJ Fanning <fa...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INFORMATIONPROVIDED

--- Comment #2 from PJ Fanning <fa...@yahoo.com> ---
Excel files store numbers as doubles and doubles are just approximations. If
you use the POI DataFormatter class, it will apply a format based on the cell
style and this can include rounding the number to the form displayed by Excel.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org