Skip to content

Percentage Formatting Issue in Excel #278

Description

@cprodhomme

Screenshot:

Image

File :

20250228-mg-11-pdm25 (1).xls

Description:

There appears to be a formatting issue when viewing percentage values in certain versions of Excel using the Gem spreadsheet. Specifically, the issue arises starting from some rows onwards, where percentages are not displayed correctly.

Affected Version of Excel:

  • Microsoft® Excel® for Microsoft 365 MSO (Version 2502 Build 16.0.18526.20144) 32-bit (Windows)
  • Microsoft Excel for MacOS - version 16.79.2 (23112723)

Steps to Reproduce:

Generate a spreadsheet using the Gem spreadsheet with percentage values.
Open the spreadsheet in the specified version of Excel.
Notice that from a certain row, the percentage formatting fails.
Expected Behavior:

Percentages should be consistently formatted across all rows in Excel without issues.

PERCENTAGE_FORMAT = '0%'
Spreadsheet::Format.new(
  number_format: PERCENTAGE_FORMAT
)

Actual Behavior:

The percentage formatting is incorrect starting from specific rows, as shown in the attached screenshot.

Additional Details:

The code simply loops over each row to apply formatting, so there’s no apparent reason for the formatting to start failing at certain points. This suggests an issue with the gem or its interaction with Excel.

Additional Information:

Any assistance or guidance on resolving this issue would be greatly appreciated.

Thank you!

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions