Socket
Socket
Sign inDemoInstall

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.6.0 to 0.6.1

2

package.json
{
"name": "ssf",
"version": "0.6.0",
"version": "0.6.1",
"author": "SheetJS",

@@ -5,0 +5,0 @@ "description": "pure-JS library to format data using ECMA-376 spreadsheet Format Codes",

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

function rpad(v,d,c){var t=String(v);return t.length>=d?t:(t+fill(c||0,d-t.length));}
SSF.version = '0.6.0';
SSF.version = '0.6.1';
/* Options */

@@ -263,2 +263,3 @@ var opts_fmt = {};

}
if((r = fmt.match(/^#,#*,#0/))) return write_num(type,fmt.replace(/^#,#*,/,""),val);
if((r = fmt.match(/^([?]+)([ ]?)\/([ ]?)([?]+)/))) {

@@ -274,2 +275,6 @@ rr = Math.min(Math.max(r[1].length, r[4].length),7);

}
if((r = fmt.match(/^00,000\.([#0]*0)$/))) {
rr = val == Math.floor(val) ? 0 : Math.round((val-Math.floor(val))*Math.pow(10,r[1].length));
return val < 0 ? "-" + write_num(type, fmt, -val) : commaify(String(Math.floor(val))).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function($$) { return "00," + ($$.length < 3 ? pad(0,3-$$.length) : "") + $$; }) + "." + pad(rr,r[1].length,0);
}
switch(fmt) {

@@ -356,3 +361,3 @@ case "0": case "#0": return Math.round(val);

q={t:c, v:o}; out.push(q); lst = c; break;
case '*': ++i; if(fmt[i] == ' ') ++i; break; // **
case '*': ++i; if(fmt[i] == ' ' || fmt[i] == '*') ++i; break; // **
case '(': case ')': out.push({t:(flen===1?'t':c),v:c}); ++i; break;

@@ -359,0 +364,0 @@ case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':

@@ -467,2 +467,3 @@ # SSF

}
if((r = fmt.match(/^#,#*,#0/))) return write_num(type,fmt.replace(/^#,#*,/,""),val);
```

@@ -488,2 +489,11 @@

```js>tmp/60_number.js
if((r = fmt.match(/^00,000\.([#0]*0)$/))) {
rr = val == Math.floor(val) ? 0 : Math.round((val-Math.floor(val))*Math.pow(10,r[1].length));
```
Note that this is technically incorrect
```
return val < 0 ? "-" + write_num(type, fmt, -val) : commaify(String(Math.floor(val))).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function($$) { return "00," + ($$.length < 3 ? pad(0,3-$$.length) : "") + $$; }) + "." + pad(rr,r[1].length,0);
}
switch(fmt) {

@@ -653,3 +663,3 @@ case "0": case "#0": return Math.round(val);

```
case '*': ++i; if(fmt[i] == ' ') ++i; break; // **
case '*': ++i; if(fmt[i] == ' ' || fmt[i] == '*') ++i; break; // **
```

@@ -1055,5 +1065,9 @@

.PHONY: coveralls
.PHONY: coveralls full_coveralls
full_coveralls:
mocha --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
coveralls:
mocha --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
MINTEST=1 make full_coveralls
```

@@ -1064,3 +1078,3 @@

"name": "ssf",
"version": "0.6.0",
"version": "0.6.1",
"author": "SheetJS",

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

assert.equal(actual, expected);
} else assert.throws(function() { SSF.format(d[0], d[j][0]); });
} else if(d[j][2] !== "#") assert.throws(function() { SSF.format(d[0], d[j][0]); });
}

@@ -1256,0 +1270,0 @@ });

@@ -13,3 +13,3 @@ /* vim: set ts=2: */

assert.equal(actual, expected);
} else assert.throws(function() { SSF.format(d[0], d[j][0]); });
} else if(d[j][2] !== "#") assert.throws(function() { SSF.format(d[0], d[j][0]); });
}

@@ -16,0 +16,0 @@ });

@@ -50,3 +50,27 @@ [

["0.##", [1,"1."], [-1,"-1."], [0, "0."], [1.1, "1.1"], [-1.2, "-1.2"], [1000000000000.01, "1000000000000.01"], [-1000.01, "-1000.01"], [0.1, "0.1"], [1.007, "1.01"], [-1.008, "-1.01"]],
["** #,###,#00,000.00,**",
[1.2345, " 00,000.00"],
[12.345, " 00,000.01"],
[123.45, " 00,000.12"],
[1234.56, " 00,001.23"],
[12345.67, " 00,012.35"],
[123456.78, " 00,123.46"],
[1234567.89, " 01,234.57"],
[12345681.9, " 12,345.68"],
[123456822, " 123,456.82"],
[1234568223, " 1,234,568.22"],
[12345682233, " 12,345,682.23"],
[123456822333, " 123,456,822.33"],
[1234568223333, " 1,234,568,223.33"],
[12345682233333, " 12,345,682,233.33"],
[123456822333333, " 123,456,822,333.33"],
[1234568223333330, " 1,234,568,223,333.33"],
[12345682233333300, " 12,345,682,233,333.30"],
[123456822333333000, " 123,456,822,333,333.00", "#"],
[1234568223333330000, " 1,234,568,223,333,330.00"],
[12345682233333300000, " 12,345,682,233,333,300.00"],
[123456822333333000000, " 123,456,822,333,333,000.00"],
[1234568223333330000000, " 1,234,568,223,333,330,000.00"]
],
["\"foo\";\"bar\";\"baz\";\"qux\";\"foobar\"", [1], [0], [-1], ["sheetjs"]]
]

Sorry, the diff of this file is not supported yet

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