Skip to content

Pad the integer part to the format's zero placeholders - #425

Open
jayhemnani9910 wants to merge 1 commit into
MathNya:masterfrom
jayhemnani9910:fix/number-format-integer-zeros
Open

jayhemnani9910 wants to merge 1 commit into
MathNya:masterfrom
jayhemnani9910:fix/number-format-integer-zeros

Conversation

@jayhemnani9910

Copy link
Copy Markdown
Contributor

get_formatted_value ignored the 0 placeholders in the integer part of a number format, so zero-padded formats lost their leading zeros: the ZIP code format 00000 showed 501 as 501, 0000 showed 1 as 1, and 000.00 showed 5.5 as 5.50.

The integer part is now padded to the number of 0 placeholders before the decimal point (# still shows only significant digits). Formats that spread digits across literals, like 000-00-0000, are not covered.

Added a unit test that fails without the change, and checked an openpyxl workbook through get_formatted_value.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant