Skip to content

Fix: Extract currency symbols and number formats from Excel cells#1609

Open
Jah-yee wants to merge 1 commit intomicrosoft:mainfrom
Jah-yee:main
Open

Fix: Extract currency symbols and number formats from Excel cells#1609
Jah-yee wants to merge 1 commit intomicrosoft:mainfrom
Jah-yee:main

Conversation

@Jah-yee
Copy link

@Jah-yee Jah-yee commented Mar 11, 2026

Summary

This PR fixes issue #53 - Excel files with currency-formatted cells only extract the numeric value, not the currency symbol.

Changes

  • Add _format_cell_value() helper function to preserve currency and number formatting
  • Support for USD ($), EUR (€), GBP (£), JPY (¥), and other currencies
  • Support for percentage formatting
  • Preserve decimal places from Excel number format
  • Use openpyxl directly instead of pandas for better format control

Testing

Tested with multiple currency formats:

  • USD: $1,199.50
  • EUR: €999.99
  • GBP: £750.00
  • JPY: ¥150,000
  • Percentages: 25.50%

Before/After

Before:

| Cost |
| --- |
| 1199 |

After:

| Cost |
| --- |
| $1,199.50 |

Fixes #53

- Add helper function _format_cell_value() to preserve currency symbols
- Support for USD ($), EUR (€), GBP (£), JPY (¥), and other currencies
- Support for percentage formatting
- Preserve decimal places from number format
- Use openpyxl directly instead of pandas for better format control

Fixes microsoft#53
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.

Unable to extract currency from excel formatted cells

1 participant