Skip to content

No way to control display format when exporting to excel #22027

Closed
@marknsikora

Description

@marknsikora

Code Sample, a copy-pastable example if possible

# format call does nothing
df.style.format("{:.2%}").to_excel('styled.xlsx')

Problem description

The current excel styler doesn't implement anything for the styler format method. To get number format there are two possible options. First is to connect this method to something. Second is to allow some way to set the number_format attribute on excel cells. The second option is a bit cleaner IMHO since data conversion like truncating decimal places can result in loss of information and number_format is also sort of how excel declares data types eg. displaying a number as a time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions