Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work for some symbols #30

Open
Crampichon opened this issue Jan 6, 2021 · 1 comment
Open

Does not work for some symbols #30

Crampichon opened this issue Jan 6, 2021 · 1 comment

Comments

@Crampichon
Copy link

Hi @andersnm,

Thank you for this work, really helpful!

We noticed that the Library was to able to parse ¥ and £ in NumberFormats (but € works for example).
We found a workaround which is to simply add quotes: "¥" will work.

Example:
(€* #,##0);(€* (#,##0);(€* "-");(@) will be parsed and format the value as expected.
(¥* #,##0);
(¥* (#,##0);(¥* "-");(@) causes error.
("¥"* #,##0);("¥"* (#,##0);("¥"* "-");(@_) will be parsed and format the value as expected.

Cheers,
Romain

@andersnm
Copy link
Owner

Hi!

Thanks for this. Indeed Excel (2016) accepts any non-token literals in number formats, and so should this library. Surprised this wasn't caught before, although if you input that number format manually in Excel and save, and then inspect the XML it has been escaped:

<numFmt numFmtId="166" formatCode="\(\¥* #,##0\);\(\¥* \(#,##0\);\(\¥* &quot;-&quot;\);\(@\)"/>

I supect those characters are technically "non-standard", iirc the spec defines a relatively short list of permitted characters.

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

No branches or pull requests

2 participants