Skip to content

Rounding does not always match Excel's display values #1105

Description

@tom-groves

Hi there

For certain cell values the xlsx package yields different formatted display text than Excel.

A full example with a file is available at https://github.com/feverpitch-tom/xlsx-rounding-demo.

For manual reproduction:

Create a spreadsheet with the following three values:

  • 1.225
  • 100.665
  • 656.685

These should be formatted to display at two decimal places, and consequently are displayed as follows in Excel:

  • 1.23
  • 100.67
  • 652.69

When parsed by the xlsx package the w property for each cell, which represents the formatted value, is as follows:

  • 1.23
  • 100.67
  • 652.68

The last value (C1 in the sheet) is 0.01 less than is displayed in Excel.

Thanks

Tom

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions