Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ssf

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssf - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

5

package.json
{
"name": "ssf",
"version": "0.5.0",
"version": "0.5.1",
"author": "SheetJS",

@@ -10,3 +10,4 @@ "description": "pure-JS library to format data using ECMA-376 spreadsheet Format Codes",

"voc":"",
"colors":""
"colors":"",
"frac":"0.3.1"
},

@@ -13,0 +14,0 @@ "devDependencies": {

43

ssf.js

@@ -73,5 +73,5 @@ /* ssf.js (C) 2013-2014 SheetJS -- http://sheetjs.com */

var Q_2 = 1, Q_1 = 0, Q = 0;
var A = B|0;
var A = Math.floor(B);
while(Q_1 < D) {
A = B|0;
A = Math.floor(B);
P = A * P_1 + P_2;

@@ -87,2 +87,3 @@ Q = A * Q_1 + Q_2;

if(!mixed) return [0, sgn * P, Q];
if(Q==0) throw "Unexpected state: "+P+" "+P_1+" "+P_2+" "+Q+" "+Q_1+" "+Q_2;
var q = Math.floor(sgn * P/Q);

@@ -101,9 +102,9 @@ return [q, sgn*P - q*Q, Q];

else if(V > Math.pow(10,-9) && V < Math.pow(10,11)) {
o = v.toFixed(12).replace(/(\.[0-9]*[1-9])0*$/,"$1").replace(/\.$/,"");
o = v.toFixed(12).replace(/(\.[0-9]*[1-9])0*$/,"$1").replace(/\.$/,"");
if(o.length > 11+(v<0?1:0)) o = v.toPrecision(10);
if(o.length > 11+(v<0?1:0)) o = v.toExponential(5);
}
}
else {
o = v.toFixed(11).replace(/(\.[0-9]*[1-9])0*$/,"$1");
if(o.length > 11 + (v<0?1:0)) o = v.toPrecision(6);
if(o.length > 11 + (v<0?1:0)) o = v.toPrecision(6);
}

@@ -118,5 +119,6 @@ o = o.replace(/(\.[0-9]*[1-9])0+e/,"$1e").replace(/\.0*e/,"e");

var parse_date_code = function parse_date_code(v,opts) {
var date = Math.floor(v), time = Math.round(86400 * (v - date)), dow=0;
var date = Math.floor(v), time = Math.floor(86400 * (v - date)), dow=0;
var dout=[], out={D:date, T:time, u:86400*(v-date)-time}; fixopts(opts = (opts||{}));
if(opts.date1904) date += 1462;
if(date > 2958465) return null;
if(date === 60) {dout = [1900,2,29]; dow=3;}

@@ -180,4 +182,4 @@ else if(date === 0) {dout = [1900,1,0]; dow=6;}

case 's': return val.S;
case 'ss': return pad(val.S, 2);
case 'ss.0': return pad(val.S,2) + "." + Math.round(10*val.u);
case 'ss': return pad(Math.round(val.S+val.u), 2);
case 'ss.0': var o = pad(Math.round(10*(val.S+val.u)),3); return o.substr(0,2)+"." + o.substr(2);
default: throw 'bad second format: ' + fmt;

@@ -209,4 +211,10 @@ } break;

if(fmt == '##0.0E+0') {
var ee = Number(val.toExponential(0).substr(3))%3;
o = (val/Math.pow(10,ee%3)).toPrecision(idx+1+(ee%3)).replace(/^([+-]?)([0-9]*)\.([0-9]*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,ee) + "." + $3.substr(ee) + "E"; });
var ee = (Number(val.toExponential(0).substr(2+(val<0))))%3;
o = (val/Math.pow(10,ee)).toPrecision(idx+1+(3+ee)%3);
if(!o.match(/[Ee]/)) {
var fakee = (Number(val.toExponential(0).substr(2+(val<0))));
if(o.indexOf(".") === -1) o = o[0] + "." + o.substr(1) + "E+" + (fakee - o.length+ee);
else throw "missing E";
}
o = o.replace(/^([+-]?)([0-9]*)\.([0-9]*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(3+ee)%3) + "." + $3.substr(ee) + "E"; });
} else o = val.toExponential(idx);

@@ -235,5 +243,5 @@ if(fmt.match(/E\+00$/) && o.match(/e[+-][0-9]$/)) o = o.substr(0,o.length-1) + "0" + o[o.length-1];

case "#,##0.00": r = Math.round((val-Math.floor(val))*100); return val < 0 ? "-" + write_num(type, fmt, -val) : commaify(String(Math.floor(val))) + "." + (r < 10 ? "0"+r:r);
case "# ? / ?": ff = frac(aval, 9, true); return sign + (ff[0]||"") + " " + (ff[1] === 0 ? " " : ff[1] + "/" + ff[2]);
case "# ?? / ??": ff = frac(aval, 99, true); return sign + (ff[0]||"") + " " + (ff[1] ? pad(ff[1],2," ") + "/" + rpad(ff[2],2," ") : " ");
case "# ??? / ???": ff = frac(aval, 999, true); return sign + (ff[0]||"") + " " + (ff[1] ? pad(ff[1],3," ") + "/" + rpad(ff[2],3," ") : " ");
case "# ? / ?": ff = frac(aval, 9, true); return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] === 0 ? " " : ff[1] + "/" + ff[2]);
case "# ?? / ??": ff = frac(aval, 99, true); return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] ? pad(ff[1],2," ") + "/" + rpad(ff[2],2," ") : " ");
case "# ??? / ???": ff = frac(aval, 999, true); return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] ? pad(ff[1],3," ") + "/" + rpad(ff[2],3," ") : " ");
default:

@@ -278,2 +286,3 @@ }

if(!dt) dt = parse_date_code(v, opts);
if(!dt) return "";
o = fmt[i]; while(fmt[++i] === c) o+=c;

@@ -286,2 +295,3 @@ if(c === 's' && fmt[i] === '.' && fmt[i+1] === '0') { o+='.'; while(fmt[++i] === '0') o+= '0'; }

if(!dt) dt = parse_date_code(v, opts);
if(!dt) return "";
q={t:c,v:"A"};

@@ -335,3 +345,3 @@ if(fmt.substr(i, 3) === "A/P") {q.v = dt.H >= 12 ? "P" : "A"; q.t = 'T'; hr='h';i+=3;}

var jj = i+1;
while(out[jj] && ("? D".indexOf(out[jj].t) > -1 || out[i].t == '(' && (out[jj].t == ')' || out[jj].t == 'n') || out[jj].t == 't' && (out[jj].v == '/' || out[jj].v == '$' || (out[jj].v == ' ' && (out[jj+1]||{}).t == '?')))) {
while(out[jj] && ("?D".indexOf(out[jj].t) > -1 || (out[jj].t == " " && (out[jj+1]||{}).t === "?" ) || out[i].t == '(' && (out[jj].t == ')' || out[jj].t == 'n') || out[jj].t == 't' && (out[jj].v == '/' || out[jj].v == '$' || (out[jj].v == ' ' && (out[jj+1]||{}).t == '?')))) {
if(out[jj].v!==' ') out[i].v += ' ' + out[jj].v;

@@ -342,7 +352,6 @@ delete out[jj]; ++jj;

out[i].t = 't';
i = jj; break;
i = jj-1; break;
default: throw "unrecognized type " + out[i].t;
}
}
return out.map(function(x){return x.v;}).join("");

@@ -378,5 +387,5 @@ }

SSF.get_table = function() { return table_fmt; };
SSF.load_table = function(tbl) { for(var i=0; i!=0x0188; ++i) if(table_fmt[i]) SSF.load(i, table_fmt[i]); };
SSF.load_table = function(tbl) { for(var i=0; i!=0x0188; ++i) if(tbl[i]) SSF.load(tbl[i], i); };
};
make_ssf(SSF);
if(typeof module !== 'undefined' && typeof DO_NOT_EXPORT_SSF === 'undefined') module.exports = SSF;

@@ -149,9 +149,9 @@ # SSF

else if(V > Math.pow(10,-9) && V < Math.pow(10,11)) {
o = v.toFixed(12).replace(/(\.[0-9]*[1-9])0*$/,"$1").replace(/\.$/,"");
o = v.toFixed(12).replace(/(\.[0-9]*[1-9])0*$/,"$1").replace(/\.$/,"");
if(o.length > 11+(v<0?1:0)) o = v.toPrecision(10);
if(o.length > 11+(v<0?1:0)) o = v.toExponential(5);
}
}
else {
o = v.toFixed(11).replace(/(\.[0-9]*[1-9])0*$/,"$1");
if(o.length > 11 + (v<0?1:0)) o = v.toPrecision(6);
if(o.length > 11 + (v<0?1:0)) o = v.toPrecision(6);
}

@@ -266,3 +266,3 @@ o = o.replace(/(\.[0-9]*[1-9])0+e/,"$1e").replace(/\.0*e/,"e");

var parse_date_code = function parse_date_code(v,opts) {
var date = Math.floor(v), time = Math.round(86400 * (v - date)), dow=0;
var date = Math.floor(v), time = Math.floor(86400 * (v - date)), dow=0;
var dout=[], out={D:date, T:time, u:86400*(v-date)-time}; fixopts(opts = (opts||{}));

@@ -278,2 +278,8 @@ ```

Date codes beyond 12/31/9999 are invalid:
```
if(date > 2958465) return null;
```
Due to a bug in Lotus 1-2-3 which was propagated by Excel and other variants,

@@ -365,4 +371,15 @@ the year 1900 is recognized as a leap year. JS has no way of representing that

if(fmt == '##0.0E+0') {
var ee = Number(val.toExponential(0).substr(3))%3;
o = (val/Math.pow(10,ee%3)).toPrecision(idx+1+(ee%3)).replace(/^([+-]?)([0-9]*)\.([0-9]*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,ee) + "." + $3.substr(ee) + "E"; });
var ee = (Number(val.toExponential(0).substr(2+(val<0))))%3;
o = (val/Math.pow(10,ee)).toPrecision(idx+1+(3+ee)%3);
if(!o.match(/[Ee]/)) {
```
TODO: something reasonable
```
var fakee = (Number(val.toExponential(0).substr(2+(val<0))));
if(o.indexOf(".") === -1) o = o[0] + "." + o.substr(1) + "E+" + (fakee - o.length+ee);
else throw "missing E";
}
o = o.replace(/^([+-]?)([0-9]*)\.([0-9]*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(3+ee)%3) + "." + $3.substr(ee) + "E"; });
} else o = val.toExponential(idx);

@@ -411,5 +428,5 @@ if(fmt.match(/E\+00$/) && o.match(/e[+-][0-9]$/)) o = o.substr(0,o.length-1) + "0" + o[o.length-1];

```js>tmp/60_number.js
case "# ? / ?": ff = frac(aval, 9, true); return sign + (ff[0]||"") + " " + (ff[1] === 0 ? " " : ff[1] + "/" + ff[2]);
case "# ?? / ??": ff = frac(aval, 99, true); return sign + (ff[0]||"") + " " + (ff[1] ? pad(ff[1],2," ") + "/" + rpad(ff[2],2," ") : " ");
case "# ??? / ???": ff = frac(aval, 999, true); return sign + (ff[0]||"") + " " + (ff[1] ? pad(ff[1],3," ") + "/" + rpad(ff[2],3," ") : " ");
case "# ? / ?": ff = frac(aval, 9, true); return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] === 0 ? " " : ff[1] + "/" + ff[2]);
case "# ?? / ??": ff = frac(aval, 99, true); return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] ? pad(ff[1],2," ") + "/" + rpad(ff[2],2," ") : " ");
case "# ??? / ???": ff = frac(aval, 999, true); return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] ? pad(ff[1],3," ") + "/" + rpad(ff[2],3," ") : " ");
default:

@@ -482,2 +499,3 @@ }

if(!dt) dt = parse_date_code(v, opts);
if(!dt) return "";
o = fmt[i]; while(fmt[++i] === c) o+=c;

@@ -511,2 +529,3 @@ ```

if(!dt) dt = parse_date_code(v, opts);
if(!dt) return "";
q={t:c,v:"A"};

@@ -549,3 +568,3 @@ if(fmt.substr(i, 3) === "A/P") {q.v = dt.H >= 12 ? "P" : "A"; q.t = 'T'; hr='h';i+=3;}

Due to how the CSV generation works, asterisk characters are discarded. TODO:
Due to how the CSV generation works, asterisk characters are discarded. TODO:
communicate this somehow, possibly with an option

@@ -602,3 +621,3 @@

var jj = i+1;
while(out[jj] && ("? D".indexOf(out[jj].t) > -1 || out[i].t == '(' && (out[jj].t == ')' || out[jj].t == 'n') || out[jj].t == 't' && (out[jj].v == '/' || out[jj].v == '$' || (out[jj].v == ' ' && (out[jj+1]||{}).t == '?')))) {
while(out[jj] && ("?D".indexOf(out[jj].t) > -1 || (out[jj].t == " " && (out[jj+1]||{}).t === "?" ) || out[i].t == '(' && (out[jj].t == ')' || out[jj].t == 'n') || out[jj].t == 't' && (out[jj].v == '/' || out[jj].v == '$' || (out[jj].v == ' ' && (out[jj+1]||{}).t == '?')))) {
if(out[jj].v!==' ') out[i].v += ' ' + out[jj].v;

@@ -609,7 +628,6 @@ delete out[jj]; ++jj;

out[i].t = 't';
i = jj; break;
i = jj-1; break;
default: throw "unrecognized type " + out[i].t;
}
}
return out.map(function(x){return x.v;}).join("");

@@ -668,4 +686,4 @@ }

case 's': return val.S;
case 'ss': return pad(val.S, 2);
case 'ss.0': return pad(val.S,2) + "." + Math.round(10*val.u);
case 'ss': return pad(Math.round(val.S+val.u), 2);
case 'ss.0': var o = pad(Math.round(10*(val.S+val.u)),3); return o.substr(0,2)+"." + o.substr(2);
default: throw 'bad second format: ' + fmt;

@@ -745,7 +763,7 @@ } break;

To support multiple SSF tables:
To support multiple SSF tables:
```
SSF.get_table = function() { return table_fmt; };
SSF.load_table = function(tbl) { for(var i=0; i!=0x0188; ++i) if(table_fmt[i]) SSF.load(i, table_fmt[i]); };
SSF.load_table = function(tbl) { for(var i=0; i!=0x0188; ++i) if(tbl[i]) SSF.load(tbl[i], i); };
```

@@ -763,5 +781,5 @@

var Q_2 = 1, Q_1 = 0, Q = 0;
var A = B|0;
var A = Math.floor(B);
while(Q_1 < D) {
A = B|0;
A = Math.floor(B);
P = A * P_1 + P_2;

@@ -777,2 +795,3 @@ Q = A * Q_1 + Q_2;

if(!mixed) return [0, sgn * P, Q];
if(Q==0) throw "Unexpected state: "+P+" "+P_1+" "+P_2+" "+Q+" "+Q_1+" "+Q_2;
var q = Math.floor(sgn * P/Q);

@@ -835,3 +854,3 @@ return [q, sgn*P - q*Q, Q];

"name": "ssf",
"version": "0.5.0",
"version": "0.5.1",
"author": "SheetJS",

@@ -843,3 +862,4 @@ "description": "pure-JS library to format data using ECMA-376 spreadsheet Format Codes",

"voc":"",
"colors":""
"colors":"",
"frac":"0.3.1"
},

@@ -878,3 +898,2 @@ "devDependencies": {

```js>test/implied.js
/* vim: set ts=2: */
var SSF = require('../');

@@ -884,5 +903,9 @@ var fs = require('fs'), assert = require('assert');

var skip = [];
function doit(d) {
d[1].forEach(function(r){if(!r[2])assert.equal(SSF.format(r[0],d[0]),r[1]);});
}
describe('implied formats', function() {
data.forEach(function(d) {
it(d[1]+" for "+d[0], skip.indexOf(d[1]) > -1 ? null : function(){
if(d.length == 2) it(d[0], function() { doit(d); });
else it(d[1]+" for "+d[0], skip.indexOf(d[1]) > -1 ? null : function(){
assert.equal(SSF.format(d[1], d[0], {}), d[2]);

@@ -889,0 +912,0 @@ });

@@ -1,2 +0,1 @@

/* vim: set ts=2: */
var SSF = require('../');

@@ -6,5 +5,9 @@ var fs = require('fs'), assert = require('assert');

var skip = [];
function doit(d) {
d[1].forEach(function(r){if(!r[2])assert.equal(SSF.format(r[0],d[0]),r[1]);});
}
describe('implied formats', function() {
data.forEach(function(d) {
it(d[1]+" for "+d[0], skip.indexOf(d[1]) > -1 ? null : function(){
if(d.length == 2) it(d[0], function() { doit(d); });
else it(d[1]+" for "+d[0], skip.indexOf(d[1]) > -1 ? null : function(){
assert.equal(SSF.format(d[1], d[0], {}), d[2]);

@@ -11,0 +14,0 @@ });

[
[12345.6789, 0, "12345.6789"],
[12345.6789, 1, "12346"],
[12345.6789, 2, "12345.68"],
[12345.6789, 3, "12,346"],
[12345.6789, 4, "12,345.68"],
[12345.6789, 9, "1234568%"],
[12345.6789, 10, "1234567.89%"],
[12345.6789, 11, "1.23E+04"],
[12345.6789, 12, "12345 2/3"],
[12345.6789, 13, "12345 55/81"],
[12345.6789, 14, "10/18/33"],
[12345.6789, 15, "18-Oct-33"],
[12345.6789, 16, "18-Oct"],
[12345.6789, 17, "Oct-33"],
[12345.6789, 18, "4:17 PM"],
[12345.6789, 19, "4:17:37 PM"],
[12345.6789, 20, "16:17"],
[12345.6789, 21, "16:17:37"],
[12345.6789, 22, "10/18/33 16:17"],
[12345.6789, 37, "12,346"],
[12345.6789, 38, "12,346"],
[12345.6789, 39, "12,345.68"],
[12345.6789, 40, "12,345.68"],
[12345.6789, 45, "17:37"],
[12345.6789, 46, "296296:17:37"],
[12345.6789, 47, "1737.0"],
[12345.6789, 48, "12.3E+3"],
[12345.6789, 49, "12345.6789"],
[1234567890000, [
[0, "1.23457E+12", true],
[1, "1234567890000"],
[2, "1234567890000.00"],
[3, "1,234,567,890,000"],
[4, "1,234,567,890,000.00"],
[9, "123456789000000%"],
[10, "123456789000000.00%"],
[11, "1.23E+12"],
[12, "1234567890000 "],
[13, "1234567890000 "],
[14, ""],
[15, ""],
[16, ""],
[17, ""],
[18, ""],
[19, ""],
[20, ""],
[21, ""],
[22, ""],
[37, "1,234,567,890,000 "],
[38, "1,234,567,890,000 "],
[39, "1,234,567,890,000.00"],
[40, "1,234,567,890,000.00"],
[45, ""],
[46, ""],
[47, ""],
[48, "1.2E+12"],
[49, "1.23457E+12", true]
]],
[-12345.6789, 0, "-12345.6789"],
[-12345.6789, 1, "-12346"],
[-12345.6789, 2, "-12345.68"],
[-12345.6789, 3, "-12,346"],
[-12345.6789, 4, "-12,345.68"],
[-12345.6789, 9, "-1234568%"],
[-12345.6789, 10, "-1234567.89%"],
[-12345.6789, 11, "-1.23E+04"],
[-12345.6789, 12, "-12345 2/3"],
[-12345.6789, 13, "-12345 55/81"],
[-12345.6789, 14, ""],
[-12345.6789, 15, ""],
[-12345.6789, 16, ""],
[-12345.6789, 17, ""],
[-12345.6789, 18, ""],
[-12345.6789, 19, ""],
[-12345.6789, 20, ""],
[-12345.6789, 21, ""],
[-12345.6789, 22, ""],
[-12345.6789, 37, "(12,346)"],
[-12345.6789, 38, "(12,346)"],
[-12345.6789, 39, "(12,345.68)"],
[-12345.6789, 40, "(12,345.68)"],
[-12345.6789, 45, ""],
[-12345.6789, 46, ""],
[-12345.6789, 47, ""],
[-12345.6789, 48, "-12.3E+3"],
[-12345.6789, 49, "-12345.6789"],
[123456789000, [
[0, "1.23457E+11"],
[1, "123456789000"],
[2, "123456789000.00"],
[3, "123,456,789,000"],
[4, "123,456,789,000.00"],
[9, "12345678900000%"],
[10, "12345678900000.00%"],
[11, "1.23E+11"],
[12, "123456789000 "],
[13, "123456789000 "],
[14, ""],
[15, ""],
[16, ""],
[17, ""],
[18, ""],
[19, ""],
[20, ""],
[21, ""],
[22, ""],
[37, "123,456,789,000 "],
[38, "123,456,789,000 "],
[39, "123,456,789,000.00"],
[40, "123,456,789,000.00"],
[45, ""],
[46, ""],
[47, ""],
[48, "123.5E+9", true],
[49, "1.23457E+11", true]
]],
[12345678900, [
[0, "12345678900"],
[1, "12345678900"],
[2, "12345678900.00"],
[3, "12,345,678,900"],
[4, "12,345,678,900.00"],
[9, "1234567890000%"],
[10, "1234567890000.00%"],
[11, "1.23E+10"],
[12, "12345678900 "],
[13, "12345678900 "],
[14, ""],
[15, ""],
[16, ""],
[17, ""],
[18, ""],
[19, ""],
[20, ""],
[21, ""],
[22, ""],
[37, "12,345,678,900 "],
[38, "12,345,678,900 "],
[39, "12,345,678,900.00"],
[40, "12,345,678,900.00"],
[45, ""],
[46, ""],
[47, ""],
[48, "12.3E+9"],
[49, "12345678900"]
]],
[1234567890, [
[0, "1234567890"],
[1, "1234567890"],
[2, "1234567890.00"],
[3, "1,234,567,890"],
[4, "1,234,567,890.00"],
[9, "123456789000%"],
[10, "123456789000.00%"],
[11, "1.23E+09"],
[12, "1234567890 "],
[13, "1234567890 "],
[14, ""],
[15, ""],
[16, ""],
[17, ""],
[18, ""],
[19, ""],
[20, ""],
[21, ""],
[22, ""],
[37, "1,234,567,890 "],
[38, "1,234,567,890 "],
[39, "1,234,567,890.00"],
[40, "1,234,567,890.00"],
[45, ""],
[46, ""],
[47, ""],
[48, "1.2E+9"],
[49, "1234567890"]
]],
[123456789, [
[0, "123456789"],
[1, "123456789"],
[2, "123456789.00"],
[3, "123,456,789"],
[4, "123,456,789.00"],
[9, "12345678900%"],
[10, "12345678900.00%"],
[11, "1.23E+08"],
[12, "123456789 "],
[13, "123456789 "],
[14, ""],
[15, ""],
[16, ""],
[17, ""],
[18, ""],
[19, ""],
[20, ""],
[21, ""],
[22, ""],
[37, "123,456,789 "],
[38, "123,456,789 "],
[39, "123,456,789.00"],
[40, "123,456,789.00"],
[45, ""],
[46, ""],
[47, ""],
[48, "123.5E+6"],
[49, "123456789"]
]],
[12345678.9, [
[0, "12345678.9"],
[1, "12345679"],
[2, "12345678.90"],
[3, "12,345,679"],
[4, "12,345,678.90"],
[9, "1234567890%"],
[10, "1234567890.00%"],
[11, "1.23E+07"],
[12, "12345679 "],
[13, "12345678 9/10"],
[14, ""],
[15, ""],
[16, ""],
[17, ""],
[18, ""],
[19, ""],
[20, ""],
[21, ""],
[22, ""],
[37, "12,345,679 "],
[38, "12,345,679 "],
[39, "12,345,678.90"],
[40, "12,345,678.90"],
[45, ""],
[46, ""],
[47, ""],
[48, "12.3E+6"],
[49, "12345678.9"]
]],
[1234567.89, [
[0, "1234567.89"],
[1, "1234568"],
[2, "1234567.89"],
[3, "1,234,568"],
[4, "1,234,567.89"],
[9, "123456789%"],
[10, "123456789.00%"],
[11, "1.23E+06"],
[12, "1234567 8/9"],
[13, "1234567 8/9 "],
[14, "2/15/80"],
[15, "15-Feb-80"],
[16, "15-Feb"],
[17, "Feb-80"],
[18, "9:21 PM"],
[19, "9:21:36 PM"],
[20, "21:21"],
[21, "21:21:36"],
[22, "2/15/80 21:21"],
[37, "1,234,568 "],
[38, "1,234,568 "],
[39, "1,234,567.89"],
[40, "1,234,567.89"],
[45, "21:36"],
[46, "29629629:21:36"],
[47, "2136.0"],
[48, "1.2E+6"],
[49, "1234567.89"]
]],
[123456.789, [
[0, "123456.789"],
[1, "123457"],
[2, "123456.79"],
[3, "123,457"],
[4, "123,456.79"],
[9, "12345679%"],
[10, "12345678.90%"],
[11, "1.23E+05"],
[12, "123456 4/5"],
[13, "123456 15/19"],
[14, "1/3/38"],
[15, "3-Jan-38"],
[16, "3-Jan"],
[17, "Jan-38"],
[18, "6:56 PM"],
[19, "6:56:10 PM"],
[20, "18:56"],
[21, "18:56:10"],
[22, "1/3/38 18:56"],
[37, "123,457 "],
[38, "123,457 "],
[39, "123,456.79"],
[40, "123,456.79"],
[45, "56:10"],
[46, "2962962:56:10"],
[47, "5609.6"],
[48, "123.5E+3"],
[49, "123456.789"]
]],
[12345.6789, [
[0, "12345.6789"],
[1, "12346"],
[2, "12345.68"],
[3, "12,346"],
[4, "12,345.68"],
[9, "1234568%"],
[10, "1234567.89%"],
[11, "1.23E+04"],
[12, "12345 2/3"],
[13, "12345 55/81"],
[14, "10/18/33"],
[15, "18-Oct-33"],
[16, "18-Oct"],
[17, "Oct-33"],
[18, "4:17 PM"],
[19, "4:17:37 PM"],
[20, "16:17"],
[21, "16:17:37"],
[22, "10/18/33 16:17"],
[37, "12,346 "],
[38, "12,346 "],
[39, "12,345.68"],
[40, "12,345.68"],
[45, "17:37"],
[46, "296296:17:37"],
[47, "1737.0"],
[48, "12.3E+3"],
[49, "12345.6789"]
]],
[1234.56789, [
[0, "1234.56789"],
[1, "1235"],
[2, "1234.57"],
[3, "1,235"],
[4, "1,234.57"],
[9, "123457%"],
[10, "123456.79%"],
[11, "1.23E+03"],
[12, "1234 4/7"],
[13, "1234 46/81"],
[14, "5/18/03"],
[15, "18-May-03"],
[16, "18-May"],
[17, "May-03"],
[18, "1:37 PM"],
[19, "1:37:46 PM"],
[20, "13:37"],
[21, "13:37:46"],
[22, "5/18/03 13:37"],
[37, "1,235 "],
[38, "1,235 "],
[39, "1,234.57"],
[40, "1,234.57"],
[45, "37:46"],
[46, "29629:37:46"],
[47, "3745.7"],
[48, "1.2E+3"],
[49, "1234.56789"]
]],
[123.456789, [
[0, "123.456789"],
[1, "123"],
[2, "123.46"],
[3, "123"],
[4, "123.46"],
[9, "12346%"],
[10, "12345.68%"],
[11, "1.23E+02"],
[12, "123 1/2"],
[13, "123 37/81"],
[14, "5/2/00"],
[15, "2-May-00"],
[16, "2-May"],
[17, "May-00"],
[18, "10:57 AM"],
[19, "10:57:47 AM"],
[20, "10:57"],
[21, "10:57:47"],
[22, "5/2/00 10:57"],
[37, "123 "],
[38, "123 "],
[39, "123.46"],
[40, "123.46"],
[45, "57:47"],
[46, "2962:57:47"],
[47, "5746.6"],
[48, "123.5E+0", true],
[49, "123.456789"]
]],
[12.3456789, [
[0, "12.3456789"],
[1, "12"],
[2, "12.35"],
[3, "12"],
[4, "12.35"],
[9, "1235%"],
[10, "1234.57%"],
[11, "1.23E+01"],
[12, "12 1/3"],
[13, "12 28/81"],
[14, "1/12/00"],
[15, "12-Jan-00"],
[16, "12-Jan"],
[17, "Jan-00"],
[18, "8:17 AM"],
[19, "8:17:47 AM"],
[20, "8:17"],
[21, "8:17:47"],
[22, "1/12/00 8:17"],
[37, "12 "],
[38, "12 "],
[39, "12.35"],
[40, "12.35"],
[45, "17:47"],
[46, "296:17:47"],
[47, "1746.7"],
[48, "12.3E+0", true],
[49, "12.3456789"]
]],
[1.23456789, [
[0, "1.23456789"],
[1, "1"],
[2, "1.23"],
[3, "1"],
[4, "1.23"],
[9, "123%"],
[10, "123.46%"],
[11, "1.23E+00"],
[12, "1 1/4"],
[13, "1 19/81"],
[14, "1/1/00"],
[15, "1-Jan-00"],
[16, "1-Jan"],
[17, "Jan-00"],
[18, "5:37 AM"],
[19, "5:37:47 AM"],
[20, "5:37"],
[21, "5:37:47"],
[22, "1/1/00 5:37"],
[37, "1 "],
[38, "1 "],
[39, "1.23"],
[40, "1.23"],
[45, "37:47"],
[46, "29:37:47"],
[47, "3746.7"],
[48, "1.2E+0", true],
[49, "1.23456789"]
]],
[0.123456789, [
[0, "0.123456789"],
[1, "0"],
[2, "0.12"],
[3, "0"],
[4, "0.12"],
[9, "12%"],
[10, "12.35%"],
[11, "1.23E-01"],
[12, " 1/8"],
[13, " 10/81"],
[14, "1/0/00"],
[15, "0-Jan-00"],
[16, "0-Jan"],
[17, "Jan-00"],
[18, "2:57 AM"],
[19, "2:57:47 AM"],
[20, "2:57"],
[21, "2:57:47"],
[22, "1/0/00 2:57"],
[37, "0 "],
[38, "0 "],
[39, "0.12"],
[40, "0.12"],
[45, "57:47"],
[46, "2:57:47"],
[47, "5746.7"],
[48, "123.5E-3", true],
[49, "0.123456789", true]
]],
[0.0123456789, [
[0, "0.012345679"],
[1, "0"],
[2, "0.01"],
[3, "0"],
[4, "0.01"],
[9, "1%"],
[10, "1.23%"],
[11, "1.23E-02"],
[12, "0 "],
[13, " 1/81"],
[14, "1/0/00"],
[15, "0-Jan-00"],
[16, "0-Jan"],
[17, "Jan-00"],
[18, "12:17 AM"],
[19, "12:17:47 AM"],
[20, "0:17"],
[21, "0:17:47"],
[22, "1/0/00 0:17"],
[37, "0 "],
[38, "0 "],
[39, "0.01"],
[40, "0.01"],
[45, "17:47"],
[46, "0:17:47"],
[47, "1746.7"],
[48, "12.3E-3", true],
[49, "0.012345679", true]
]],
[0.00123456789, [
[0, "0.001234568"],
[1, "0"],
[2, "0.00"],
[3, "0"],
[4, "0.00"],
[9, "0%"],
[10, "0.12%"],
[11, "1.23E-03"],
[12, "0 "],
[13, "0 "],
[14, "1/0/00"],
[15, "0-Jan-00"],
[16, "0-Jan"],
[17, "Jan-00"],
[18, "12:01 AM"],
[19, "12:01:47 AM"],
[20, "0:01"],
[21, "0:01:47"],
[22, "1/0/00 0:01"],
[37, "0 "],
[38, "0 "],
[39, "0.00"],
[40, "0.00"],
[45, "01:47"],
[46, "0:01:47"],
[47, "0146.7"],
[48, "1.2E-3", true],
[49, "0.001234568", true]
]],
[0.000123456789, [
[0, "0.000123457"],
[1, "0"],
[2, "0.00"],
[3, "0"],
[4, "0.00"],
[9, "0%"],
[10, "0.01%"],
[11, "1.23E-04"],
[12, "0 "],
[13, "0 "],
[14, "1/0/00"],
[15, "0-Jan-00"],
[16, "0-Jan"],
[17, "Jan-00"],
[18, "12:00 AM"],
[19, "12:00:11 AM"],
[20, "0:00"],
[21, "0:00:11"],
[22, "1/0/00 0:00"],
[37, "0 "],
[38, "0 "],
[39, "0.00"],
[40, "0.00"],
[45, "00:11"],
[46, "0:00:11"],
[47, "0010.7"],
[48, "123.5E-6", true],
[49, "0.000123457", true]
]],
[0.0000123456789, [
[0, "1.23457E-05"],
[1, "0"],
[2, "0.00"],
[3, "0"],
[4, "0.00"],
[9, "0%"],
[10, "0.00%"],
[11, "1.23E-05"],
[12, "0 "],
[13, "0 "],
[14, "1/0/00"],
[15, "0-Jan-00"],
[16, "0-Jan"],
[17, "Jan-00"],
[18, "12:00 AM"],
[19, "12:00:01 AM"],
[20, "0:00"],
[21, "0:00:01"],
[22, "1/0/00 0:00"],
[37, "0 "],
[38, "0 "],
[39, "0.00"],
[40, "0.00"],
[45, "00:01"],
[46, "0:00:01"],
[47, "0001.1"],
[48, "12.3E-6", true],
[49, "1.23457E-05", true]
]],
[0.00000123456789, [
[0, "1.23457E-06"],
[1, "0"],
[2, "0.00"],
[3, "0"],
[4, "0.00"],
[9, "0%"],
[10, "0.00%"],
[11, "1.23E-06"],
[12, "0 "],
[13, "0 "],
[14, "1/0/00"],
[15, "0-Jan-00"],
[16, "0-Jan"],
[17, "Jan-00"],
[18, "12:00 AM"],
[19, "12:00:00 AM"],
[20, "0:00"],
[21, "0:00:00"],
[22, "1/0/00 0:00"],
[37, "0 "],
[38, "0 "],
[39, "0.00"],
[40, "0.00"],
[45, "00:00"],
[46, "0:00:00"],
[47, "0000.1"],
[48, "1.2E-6", true],
[49, "1.23457E-06", true]
]],
[0.000000123456789, [
[0, "1.23457E-07"],
[1, "0"],
[2, "0.00"],
[3, "0"],
[4, "0.00"],
[9, "0%"],
[10, "0.00%"],
[11, "1.23E-07"],
[12, "0 "],
[13, "0 "],
[14, "1/0/00"],
[15, "0-Jan-00"],
[16, "0-Jan"],
[17, "Jan-00"],
[18, "12:00 AM"],
[19, "12:00:00 AM"],
[20, "0:00"],
[21, "0:00:00"],
[22, "1/0/00 0:00"],
[37, "0 "],
[38, "0 "],
[39, "0.00"],
[40, "0.00"],
[45, "00:00"],
[46, "0:00:00"],
[47, "0000.0"],
[48, "123.5E-9", true],
[49, "1.23457E-07", true]
]],
[0.0000000123456789, [
[0, "1.23457E-08"],
[1, "0"],
[2, "0.00"],
[3, "0"],
[4, "0.00"],
[9, "0%"],
[10, "0.00%"],
[11, "1.23E-08"],
[12, "0 "],
[13, "0 "],
[14, "1/0/00"],
[15, "0-Jan-00"],
[16, "0-Jan"],
[17, "Jan-00"],
[18, "12:00 AM"],
[19, "12:00:00 AM"],
[20, "0:00"],
[21, "0:00:00"],
[22, "1/0/00 0:00"],
[37, "0 "],
[38, "0 "],
[39, "0.00"],
[40, "0.00"],
[45, "00:00"],
[46, "0:00:00"],
[47, "0000.0"],
[48, "12.3E-9", true],
[49, "1.23457E-08", true]
]],
[0.00000000123456789, [
[0, "1.23457E-09"],
[1, "0"],
[2, "0.00"],
[3, "0"],
[4, "0.00"],
[9, "0%"],
[10, "0.00%"],
[11, "1.23E-09"],
[12, "0 "],
[13, "0 "],
[14, "1/0/00"],
[15, "0-Jan-00"],
[16, "0-Jan"],
[17, "Jan-00"],
[18, "12:00 AM"],
[19, "12:00:00 AM"],
[20, "0:00"],
[21, "0:00:00"],
[22, "1/0/00 0:00"],
[37, "0 "],
[38, "0 "],
[39, "0.00"],
[40, "0.00"],
[45, "00:00"],
[46, "0:00:00"],
[47, "0000.0"],
[48, "1.2E-9", true],
[49, "1.23457E-09", true]
]],
[0.000000000123456789, [
[0, "1.23457E-10"],
[1, "0"],
[2, "0.00"],
[3, "0"],
[4, "0.00"],
[9, "0%"],
[10, "0.00%"],
[11, "1.23E-10"],
[12, "0 "],
[13, "0 "],
[14, "1/0/00"],
[15, "0-Jan-00"],
[16, "0-Jan"],
[17, "Jan-00"],
[18, "12:00 AM"],
[19, "12:00:00 AM"],
[20, "0:00"],
[21, "0:00:00"],
[22, "1/0/00 0:00"],
[37, "0 "],
[38, "0 "],
[39, "0.00"],
[40, "0.00"],
[45, "00:00"],
[46, "0:00:00"],
[47, "0000.0"],
[48, "123.5E-12", true],
[49, "1.23457E-10", true]
]],
[-12345.6789, [
[0, "-12345.6789"],
[1, "-12346"],
[2, "-12345.68"],
[3, "-12,346"],
[4, "-12,345.68"],
[9, "-1234568%"],
[10, "-1234567.89%"],
[11, "-1.23E+04"],
[12, "-12345 2/3"],
[13, "-12345 55/81"],
[14, ""],
[15, ""],
[16, ""],
[17, ""],
[18, ""],
[19, ""],
[20, ""],
[21, ""],
[22, ""],
[37, "(12,346)"],
[38, "(12,346)"],
[39, "(12,345.68)"],
[40, "(12,345.68)"],
[45, ""],
[46, ""],
[47, ""],
[48, "-12.3E+3"],
[49, "-12345.6789"]
]],
[11.666666666666666, 0, "11.66666667"],

@@ -65,4 +754,4 @@ [5.057996968497839, 0, "5.057996968"],

[-0.000006211546860868111, 0, "-6.21155E-06"],
[12345.67876, 47, "1724.9"],
[0, 0, "0"]
]
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc