ExcelNumberFormat icon indicating copy to clipboard operation
ExcelNumberFormat copied to clipboard

Does not work for some symbols

Open Crampichon opened this issue 4 years ago • 1 comments

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

Crampichon avatar Jan 06 '21 14:01 Crampichon

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.

andersnm avatar Jan 12 '21 20:01 andersnm