sheetjs icon indicating copy to clipboard operation
sheetjs copied to clipboard

General fraction formats are not supported

Open snoopyjc opened this issue 5 years ago • 1 comments

Fraction formats have the syntax approximated by /[0#,?][^0#?]+[0#?]/(([1-9][0-9])|[0#?]+)/. SSF only handles an extremely small subset of possibilities here.

For example SSF.format('#,### ?/10', 1000.1) should give 1,000 1/10 and instead gives an error (Unsupported Format).

snoopyjc avatar Oct 04 '20 03:10 snoopyjc

Another simple case:

console.log(SSF.format("?/16", 1.25))

Unsupported format error.

snoopyjc avatar Oct 04 '20 12:10 snoopyjc