Joe Cool

Results 145 issues of Joe Cool

A number format with 'E-00' always should display at least a 2-digit exponent. This only works correctly for 'E+00', not 'E-00': console.log(SSF.format("##0.0E-00", 1)) 1.0E0

Here is another one from valid.tsv (who thinks of these??): console.log(SSF.format('\c\c\c?????0"aaaa"0"bbbb"000000.00%', -12.3456789)) -ccc 0aaaa0bbbb0-1234.57% The right answer is: -ccc 0aaaa0bbbb001234.57%

Format with a condition and including a - sign loses the extra - sign: console.log(SSF.format('[

In valid.tsv, the format codes `HH[MM]` and `HH[M]` are not valid (they are rejected by Excel), and should instead be tested as error cases.

Another odd one from valid.tsv. console.log(SSF.format('0"abde".0"??"000E+00', 12.3456789)) 12abde12.3??1.235E+01 Excel gives the correct answer: 1abde.2??346E+01

To match how excel works, a # in a fraction format needs to be filled in with a given 0 to format. Details: console.log('"' +SSF.format('# ?/10', 0)+'"') " " Excel...

Formats with multiple leading 000s need to preserve these in the output: console.log(SSF.format('000.0', 1)) 1.0 (Excel gives 001.0) console.log(SSF.format('000.#', 1)) 1. (Excel gives 001.) console.log(SSF.format('000.0', 1.2)) 1.2 (Excel gives 001.2)...

Invalid format message for ?.? (and for .?) for float input. It works fine for int input. console.log(SSF.format('?.?', 1.2)) Error: unsupported format |?.?| console.log(SSF.format('?.?', 1)) 1.

The test/valid.tsv file contains tests of valid Excel formats, however Excel (2010 at least), no longer accepts [ENG] as a prefix to a format, so I just recommend just taking...

Formats like ##0.0E+0 are a generalized form of Engineering notation, where the exponent is to be a multiple of the number of digits before the '.'. Using this specified format,...