sheetjs icon indicating copy to clipboard operation
sheetjs copied to clipboard

Escaped slash is treated as fraction separator

Open snoopyjc opened this issue 5 years ago • 1 comments
trafficstars

If a / is escaped like "/" or /, and it's in a place where it could be a fraction separator, then it is incorrectly treated as a fraction separator and not a literal slash.

console.log(SSF.format('???\/???', 123.45))

formats in Excel as ' /123' and here as '2469/20'.

snoopyjc avatar Sep 27 '20 22:09 snoopyjc

This is from the ECMA Office XML Part 1 specification:

/    If this symbol is preceded and followed by a number symbol (0, #, and ?), it is interpreted as
     the fraction format symbol and will display the number in the format of a fraction. Otherwise,
     it is interpreted as the forward slash character and is displayed as such.

snoopyjc avatar Oct 04 '20 03:10 snoopyjc