Skip to content

FastExcel / libxlsxwriter: Cannot use space as thousands separator in number formats #107

@durcak

Description

@durcak

Description

When trying to use a custom number format with a space as the thousands separator, e.g.:

workbook.add_format(num_format: '# ##0.00 "€"')

FastExcel / libxlsxwriter escapes the space and other special characters, resulting in a format like #\ ##0.00\ €. Excel then displays large numbers incorrectly, e.g., 1200300.99 becomes 1200 300.99.

Steps to reproduce

  1. Create a FastExcel workbook.
  2. Add a worksheet and a number format like # ##0.00 "€".
  3. Write a number larger than 999,999 with write_number.
  4. Open the generated Excel file in Excel.

Expected behavior

The number should display with a proper space as thousands separator, e.g., 1 200 300.99 €.

Actual behavior

The number is split incorrectly because the space is escaped (#\ ##0.00\ €) and interpreted literally by Excel.

Notes

  • Using commas (,) or dots (.) works correctly, e.g., #,##0.00 "€".
  • Using a space as thousands separator is not supported due to internal escaping in libxlsxwriter.

Environment

  • FastExcel version: 0.5.0

Request

Please consider supporting non-escaped spaces as thousands separators, or provide a recommended workaround for properly displaying numbers with spaces.

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