Socket
Socket
Sign inDemoInstall

d3-format

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-format - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

.eslintrc

2

build/bundle.js

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

var version = "0.5.0"; export * from "../index"; export {version};
var version = "0.5.1"; export * from "../index"; export {version};
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define('d3-format', ['exports'], factory) :
factory((global.d3_format = {}));
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3_format = {})));
}(this, function (exports) { 'use strict';

@@ -20,7 +20,7 @@

];
};
}
function exponent(x) {
return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;
};
}

@@ -44,4 +44,19 @@ function formatGroup(grouping, thousands) {

};
};
}
function formatDefault(x, p) {
x = x.toPrecision(p);
out: for (var n = x.length, i = 1, i0 = -1, i1; i < n; ++i) {
switch (x[i]) {
case ".": i0 = i1 = i; break;
case "0": if (i0 === 0) i0 = i; i1 = i; break;
case "e": break out;
default: if (i0 > 0) i0 = 0; break;
}
}
return i0 > 0 ? x.slice(0, i0) + x.slice(i1 + 1) : x;
}
var prefixExponent;

@@ -60,3 +75,3 @@

: "0." + new Array(1 - i).join("0") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!
};
}

@@ -71,19 +86,4 @@ function formatRounded(x, p) {

: coefficient + new Array(exponent - coefficient.length + 2).join("0");
};
}
function formatDefault(x, p) {
x = x.toPrecision(p);
out: for (var n = x.length, i = 1, i0 = -1, i1; i < n; ++i) {
switch (x[i]) {
case ".": i0 = i1 = i; break;
case "0": if (i0 === 0) i0 = i; i1 = i; break;
case "e": break out;
default: if (i0 > 0) i0 = 0; break;
}
}
return i0 > 0 ? x.slice(0, i0) + x.slice(i1 + 1) : x;
};
var formatTypes = {

@@ -111,3 +111,3 @@ "": formatDefault,

return new FormatSpecifier(specifier);
};
}

@@ -205,3 +205,4 @@ function FormatSpecifier(specifier) {

var valuePrefix = prefix,
valueSuffix = suffix;
valueSuffix = suffix,
i, n, c;

@@ -224,3 +225,3 @@ if (type === "c") {

if (valueNegative) {
var i = -1, n = value.length, c;
i = -1, n = value.length;
valueNegative = false;

@@ -244,3 +245,3 @@ while (++i < n) {

if (maybeSuffix) {
var i = -1, n = value.length, c;
i = -1, n = value.length;
while (++i < n) {

@@ -273,3 +274,3 @@ if (c = value.charCodeAt(i), 48 > c || c > 57) {

return padding + valuePrefix + value + valueSuffix;
};
}

@@ -297,3 +298,3 @@ format.toString = function() {

};
};
}

@@ -318,3 +319,3 @@ var defaultLocale = locale({

grouping: [3],
currency: ["", "\xa0Kč"],
currency: ["", "\xa0Kč"]
});

@@ -464,7 +465,7 @@

return Math.max(0, -exponent(Math.abs(step)));
};
}
function precisionPrefix(step, value) {
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
};
}

@@ -474,3 +475,3 @@ function precisionRound(step, max) {

return Math.max(0, exponent(max) - exponent(step)) + 1;
};
}

@@ -480,3 +481,3 @@ var format = defaultLocale.format;

var version = "0.5.0";
var version = "0.5.1";

@@ -483,0 +484,0 @@ exports.version = version;

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

!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define("d3-format",["exports"],n):n(r.d3_format={})}(this,function(r){"use strict";function n(r,n){if((t=(r=n?r.toExponential(n-1):r.toExponential()).indexOf("e"))<0)return null;var t,e=r.slice(0,t);return[e.length>1?e[0]+e.slice(2):e,+r.slice(t+1)]}function t(r){return r=n(Math.abs(r)),r?r[1]:NaN}function e(r,n){return function(t,e){for(var i=t.length,o=[],a=0,u=r[0],c=0;i>0&&u>0&&(c+u+1>e&&(u=Math.max(1,e-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>e));)u=r[a=(a+1)%r.length];return o.reverse().join(n)}}function i(r,t){var e=n(r,t);if(!e)return r+"";var i=e[0],o=e[1],a=o-(g=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,u=i.length;return a===u?i:a>u?i+new Array(a-u+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+n(r,Math.max(0,t+a-1))[0]}function o(r,t){var e=n(r,t);if(!e)return r+"";var i=e[0],o=e[1];return 0>o?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}function a(r,n){r=r.toPrecision(n);r:for(var t,e=r.length,i=1,o=-1;e>i;++i)switch(r[i]){case".":o=t=i;break;case"0":0===o&&(o=i),t=i;break;case"e":break r;default:o>0&&(o=0)}return o>0?r.slice(0,o)+r.slice(t+1):r}function u(r){return new c(r)}function c(r){if(!(n=p.exec(r)))throw new Error("invalid format: "+r);var n,t=n[1]||" ",e=n[2]||">",i=n[3]||"-",o=n[4]||"",a=!!n[5],u=n[6]&&+n[6],c=!!n[7],s=n[8]&&+n[8].slice(1),f=n[9]||"";"n"===f?(c=!0,f="g"):d[f]||(f=""),(a||"0"===t&&"="===e)&&(a=!0,t="0",e="="),this.fill=t,this.align=e,this.sign=i,this.symbol=o,this.zero=a,this.width=u,this.comma=c,this.precision=s,this.type=f}function s(r){return r}function f(r){function n(r){function n(r){var n=M,a=x;if("c"===p)a=v(r)+a,r="";else{r=+r;var u=(0>r||0>1/r)&&(r*=-1,!0);if(r=v(r,m),u){var s,d=-1,w=r.length;for(u=!1;++d<w;)if(s=r.charCodeAt(d),s>48&&58>s||"x"===p&&s>96&&103>s||"X"===p&&s>64&&71>s){u=!0;break}}if(n=(u?"("===i?i:"-":"-"===i||"("===i?"":i)+n,a=a+("s"===p?y[8+g/3]:"")+(u&&"("===i?")":""),b)for(var s,d=-1,w=r.length;++d<w;)if(s=r.charCodeAt(d),48>s||s>57){a=(46===s?c+r.slice(d+1):r.slice(d))+a,r=r.slice(0,d);break}}l&&!f&&(r=o(r,1/0));var C=n.length+r.length+a.length,E=h>C?new Array(h-C+1).join(t):"";switch(l&&f&&(r=o(E+r,E.length?h-a.length:1/0),E=""),e){case"<":return n+r+a+E;case"=":return n+E+r+a;case"^":return E.slice(0,C=E.length>>1)+n+r+a+E.slice(C)}return E+n+r+a}r=u(r);var t=r.fill,e=r.align,i=r.sign,s=r.symbol,f=r.zero,h=r.width,l=r.comma,m=r.precision,p=r.type,M="$"===s?a[0]:"#"===s&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",x="$"===s?a[1]:/[%p]/.test(p)?"%":"",v=d[p],b=!p||/[defgprs%]/.test(p);return m=null==m?p?6:12:/[gprs]/.test(p)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),n.toString=function(){return r+""},n}function i(r,e){var i=n((r=u(r),r.type="f",r)),o=3*Math.max(-8,Math.min(8,Math.floor(t(e)/3))),a=Math.pow(10,-o),c=y[8+o/3];return function(r){return i(a*r)+c}}var o=r.grouping&&r.thousands?e(r.grouping,r.thousands):s,a=r.currency,c=r.decimal;return{format:n,formatPrefix:i}}function h(r){return Math.max(0,-t(Math.abs(r)))}function l(r,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(t(n)/3)))-t(Math.abs(r)))}function m(r,n){return r=Math.abs(r),n=Math.abs(n)-r,Math.max(0,t(n)-t(r))+1}var g,d={"":a,"%":function(r,n){return(100*r).toFixed(n)},b:function(r){return Math.round(r).toString(2)},c:function(r){return r+""},d:function(r){return Math.round(r).toString(10)},e:function(r,n){return r.toExponential(n)},f:function(r,n){return r.toFixed(n)},g:function(r,n){return r.toPrecision(n)},o:function(r){return Math.round(r).toString(8)},p:function(r,n){return o(100*r,n)},r:o,s:i,X:function(r){return Math.round(r).toString(16).toUpperCase()},x:function(r){return Math.round(r).toString(16)}},p=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;c.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],M=f({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),x=f({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),v=f({decimal:",",thousands:" ",grouping:[3],currency:[""," Kč"]}),b=f({decimal:",",thousands:"'",grouping:[3],currency:[""," CHF"]}),w=f({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),C=f({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),E=f({decimal:".",thousands:",",grouping:[3],currency:["£",""]}),S=f({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),F=f({decimal:",",thousands:" ",grouping:[3],currency:[""," €"]}),P=f({decimal:",",thousands:" ",grouping:[3],currency:["","$"]}),k=f({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),$=f({decimal:".",thousands:",",grouping:[3],currency:["₪",""]}),j=f({decimal:",",thousands:" ",grouping:[3],currency:[""," Ft"]}),z=f({decimal:",",thousands:".",grouping:[3],currency:["€",""]}),A=f({decimal:".",thousands:",",grouping:[3],currency:["","円"]}),H=f({decimal:".",thousands:",",grouping:[3],currency:["₩",""]}),K=f({decimal:",",thousands:".",grouping:[3],currency:[""," ден."]}),N=f({decimal:",",thousands:".",grouping:[3],currency:["€ ",""]}),R=f({decimal:",",thousands:".",grouping:[3],currency:["","zł"]}),D=f({decimal:",",thousands:".",grouping:[3],currency:["R$",""]}),I=f({decimal:",",thousands:" ",grouping:[3],currency:[""," руб."]}),X=f({decimal:",",thousands:" ",grouping:[3],currency:["","SEK"]}),G=f({decimal:".",thousands:",",grouping:[3],currency:["¥",""]}),J=M.format,L=M.formatPrefix,U="0.5.0";r.version=U,r.format=J,r.formatPrefix=L,r.formatLocale=f,r.formatCaEs=x,r.formatCsCz=v,r.formatDeCh=b,r.formatDeDe=w,r.formatEnCa=C,r.formatEnGb=E,r.formatEnUs=M,r.formatEsEs=S,r.formatFiFi=F,r.formatFrCa=P,r.formatFrFr=k,r.formatHeIl=$,r.formatHuHu=j,r.formatItIt=z,r.formatJaJp=A,r.formatKoKr=H,r.formatMkMk=K,r.formatNlNl=N,r.formatPlPl=R,r.formatPtBr=D,r.formatRuRu=I,r.formatSvSe=X,r.formatZhCn=G,r.formatSpecifier=u,r.precisionFixed=h,r.precisionPrefix=l,r.precisionRound=m});
!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(r.d3_format={})}(this,function(r){"use strict";function n(r,n){if((t=(r=n?r.toExponential(n-1):r.toExponential()).indexOf("e"))<0)return null;var t,e=r.slice(0,t);return[e.length>1?e[0]+e.slice(2):e,+r.slice(t+1)]}function t(r){return r=n(Math.abs(r)),r?r[1]:NaN}function e(r,n){return function(t,e){for(var i=t.length,o=[],a=0,u=r[0],c=0;i>0&&u>0&&(c+u+1>e&&(u=Math.max(1,e-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>e));)u=r[a=(a+1)%r.length];return o.reverse().join(n)}}function i(r,n){r=r.toPrecision(n);r:for(var t,e=r.length,i=1,o=-1;e>i;++i)switch(r[i]){case".":o=t=i;break;case"0":0===o&&(o=i),t=i;break;case"e":break r;default:o>0&&(o=0)}return o>0?r.slice(0,o)+r.slice(t+1):r}function o(r,t){var e=n(r,t);if(!e)return r+"";var i=e[0],o=e[1],a=o-(g=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,u=i.length;return a===u?i:a>u?i+new Array(a-u+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+n(r,Math.max(0,t+a-1))[0]}function a(r,t){var e=n(r,t);if(!e)return r+"";var i=e[0],o=e[1];return 0>o?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}function u(r){return new c(r)}function c(r){if(!(n=p.exec(r)))throw new Error("invalid format: "+r);var n,t=n[1]||" ",e=n[2]||">",i=n[3]||"-",o=n[4]||"",a=!!n[5],u=n[6]&&+n[6],c=!!n[7],s=n[8]&&+n[8].slice(1),f=n[9]||"";"n"===f?(c=!0,f="g"):d[f]||(f=""),(a||"0"===t&&"="===e)&&(a=!0,t="0",e="="),this.fill=t,this.align=e,this.sign=i,this.symbol=o,this.zero=a,this.width=u,this.comma=c,this.precision=s,this.type=f}function s(r){return r}function f(r){function n(r){function n(r){var n,a,u,s=M,d=x;if("c"===p)d=v(r)+d,r="";else{r=+r;var w=(0>r||0>1/r)&&(r*=-1,!0);if(r=v(r,m),w)for(n=-1,a=r.length,w=!1;++n<a;)if(u=r.charCodeAt(n),u>48&&58>u||"x"===p&&u>96&&103>u||"X"===p&&u>64&&71>u){w=!0;break}if(s=(w?"("===i?i:"-":"-"===i||"("===i?"":i)+s,d=d+("s"===p?y[8+g/3]:"")+(w&&"("===i?")":""),b)for(n=-1,a=r.length;++n<a;)if(u=r.charCodeAt(n),48>u||u>57){d=(46===u?c+r.slice(n+1):r.slice(n))+d,r=r.slice(0,n);break}}l&&!f&&(r=o(r,1/0));var C=s.length+r.length+d.length,E=h>C?new Array(h-C+1).join(t):"";switch(l&&f&&(r=o(E+r,E.length?h-d.length:1/0),E=""),e){case"<":return s+r+d+E;case"=":return s+E+r+d;case"^":return E.slice(0,C=E.length>>1)+s+r+d+E.slice(C)}return E+s+r+d}r=u(r);var t=r.fill,e=r.align,i=r.sign,s=r.symbol,f=r.zero,h=r.width,l=r.comma,m=r.precision,p=r.type,M="$"===s?a[0]:"#"===s&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",x="$"===s?a[1]:/[%p]/.test(p)?"%":"",v=d[p],b=!p||/[defgprs%]/.test(p);return m=null==m?p?6:12:/[gprs]/.test(p)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),n.toString=function(){return r+""},n}function i(r,e){var i=n((r=u(r),r.type="f",r)),o=3*Math.max(-8,Math.min(8,Math.floor(t(e)/3))),a=Math.pow(10,-o),c=y[8+o/3];return function(r){return i(a*r)+c}}var o=r.grouping&&r.thousands?e(r.grouping,r.thousands):s,a=r.currency,c=r.decimal;return{format:n,formatPrefix:i}}function h(r){return Math.max(0,-t(Math.abs(r)))}function l(r,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(t(n)/3)))-t(Math.abs(r)))}function m(r,n){return r=Math.abs(r),n=Math.abs(n)-r,Math.max(0,t(n)-t(r))+1}var g,d={"":i,"%":function(r,n){return(100*r).toFixed(n)},b:function(r){return Math.round(r).toString(2)},c:function(r){return r+""},d:function(r){return Math.round(r).toString(10)},e:function(r,n){return r.toExponential(n)},f:function(r,n){return r.toFixed(n)},g:function(r,n){return r.toPrecision(n)},o:function(r){return Math.round(r).toString(8)},p:function(r,n){return a(100*r,n)},r:a,s:o,X:function(r){return Math.round(r).toString(16).toUpperCase()},x:function(r){return Math.round(r).toString(16)}},p=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;c.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],M=f({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),x=f({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),v=f({decimal:",",thousands:" ",grouping:[3],currency:[""," Kč"]}),b=f({decimal:",",thousands:"'",grouping:[3],currency:[""," CHF"]}),w=f({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),C=f({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),E=f({decimal:".",thousands:",",grouping:[3],currency:["£",""]}),S=f({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),F=f({decimal:",",thousands:" ",grouping:[3],currency:[""," €"]}),P=f({decimal:",",thousands:" ",grouping:[3],currency:["","$"]}),k=f({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),$=f({decimal:".",thousands:",",grouping:[3],currency:["₪",""]}),j=f({decimal:",",thousands:" ",grouping:[3],currency:[""," Ft"]}),z=f({decimal:",",thousands:".",grouping:[3],currency:["€",""]}),A=f({decimal:".",thousands:",",grouping:[3],currency:["","円"]}),H=f({decimal:".",thousands:",",grouping:[3],currency:["₩",""]}),K=f({decimal:",",thousands:".",grouping:[3],currency:[""," ден."]}),N=f({decimal:",",thousands:".",grouping:[3],currency:["€ ",""]}),R=f({decimal:",",thousands:".",grouping:[3],currency:["","zł"]}),D=f({decimal:",",thousands:".",grouping:[3],currency:["R$",""]}),I=f({decimal:",",thousands:" ",grouping:[3],currency:[""," руб."]}),X=f({decimal:",",thousands:" ",grouping:[3],currency:["","SEK"]}),G=f({decimal:".",thousands:",",grouping:[3],currency:["¥",""]}),J=M.format,L=M.formatPrefix,U="0.5.1";r.version=U,r.format=J,r.formatPrefix=L,r.formatLocale=f,r.formatCaEs=x,r.formatCsCz=v,r.formatDeCh=b,r.formatDeDe=w,r.formatEnCa=C,r.formatEnGb=E,r.formatEnUs=M,r.formatEsEs=S,r.formatFiFi=F,r.formatFrCa=P,r.formatFrFr=k,r.formatHeIl=$,r.formatHuHu=j,r.formatItIt=z,r.formatJaJp=A,r.formatKoKr=H,r.formatMkMk=K,r.formatNlNl=N,r.formatPlPl=R,r.formatPtBr=D,r.formatRuRu=I,r.formatSvSe=X,r.formatZhCn=G,r.formatSpecifier=u,r.precisionFixed=h,r.precisionPrefix=l,r.precisionRound=m});
{
"name": "d3-format",
"version": "0.5.0",
"version": "0.5.1",
"description": "Format numbers for human consumption.",

@@ -23,9 +23,10 @@ "keywords": [

"scripts": {
"pretest": "mkdir -p build && node -e 'process.stdout.write(\"var version = \\\"\" + require(\"./package.json\").version + \"\\\"; export * from \\\"../index\\\"; export {version};\");' > build/bundle.js && rollup -f umd -u d3-format -n d3_format -o build/d3-format.js -- build/bundle.js",
"test": "faucet `find test -name '*-test.js'`",
"prepublish": "npm run test && uglifyjs build/d3-format.js -c -m -o build/d3-format.min.js && rm -f build/d3-format.zip && zip -j build/d3-format.zip -- LICENSE README.md build/d3-format.js build/d3-format.min.js"
"pretest": "mkdir -p build && node -e 'process.stdout.write(\"var version = \\\"\" + require(\"./package.json\").version + \"\\\"; export * from \\\"../index\\\"; export {version};\");' > build/bundle.js && rollup -f umd -n d3_format -o build/d3-format.js -- build/bundle.js",
"test": "faucet `find test -name '*-test.js'` && eslint index.js src",
"prepublish": "npm run test && uglifyjs build/d3-format.js -c -m -o build/d3-format.min.js && rm -f build/d3-format.zip && zip -j build/d3-format.zip -- LICENSE README.md build/d3-format.js build/d3-format.min.js",
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git tag -am \"Release $VERSION.\" v${VERSION} && git push --tags && cp build/d3-format.js ../d3.github.com/d3-format.v0.5.js && cp build/d3-format.min.js ../d3.github.com/d3-format.v0.5.min.js && cd ../d3.github.com && git add d3-format.v0.5.js d3-format.v0.5.min.js && git commit -m \"d3-format ${VERSION}\" && git push"
},
"devDependencies": {
"faucet": "0.0",
"rollup": "0.20.5",
"rollup": "0.25",
"tape": "4",

@@ -32,0 +33,0 @@ "uglify-js": "2"

@@ -5,2 +5,2 @@ import formatDecimal from "./formatDecimal";

return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;
};
}

@@ -14,2 +14,2 @@ // Computes the decimal coefficient and exponent of the specified number x with

];
};
}

@@ -14,2 +14,2 @@ export default function(x, p) {

return i0 > 0 ? x.slice(0, i0) + x.slice(i1 + 1) : x;
};
}

@@ -18,2 +18,2 @@ export default function(grouping, thousands) {

};
};
}

@@ -16,2 +16,2 @@ import formatDecimal from "./formatDecimal";

: "0." + new Array(1 - i).join("0") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!
};
}

@@ -11,2 +11,2 @@ import formatDecimal from "./formatDecimal";

: coefficient + new Array(exponent - coefficient.length + 2).join("0");
};
}

@@ -8,3 +8,3 @@ import formatTypes from "./formatTypes";

return new FormatSpecifier(specifier);
};
}

@@ -11,0 +11,0 @@ function FormatSpecifier(specifier) {

@@ -52,3 +52,4 @@ import exponent from "./exponent";

var valuePrefix = prefix,
valueSuffix = suffix;
valueSuffix = suffix,
i, n, c;

@@ -71,3 +72,3 @@ if (type === "c") {

if (valueNegative) {
var i = -1, n = value.length, c;
i = -1, n = value.length;
valueNegative = false;

@@ -91,3 +92,3 @@ while (++i < n) {

if (maybeSuffix) {
var i = -1, n = value.length, c;
i = -1, n = value.length;
while (++i < n) {

@@ -120,3 +121,3 @@ if (c = value.charCodeAt(i), 48 > c || c > 57) {

return padding + valuePrefix + value + valueSuffix;
};
}

@@ -144,2 +145,2 @@ format.toString = function() {

};
};
}

@@ -7,3 +7,3 @@ import locale from "../locale";

grouping: [3],
currency: ["", "\xa0Kč"],
currency: ["", "\xa0Kč"]
});

@@ -5,2 +5,2 @@ import exponent from "./exponent";

return Math.max(0, -exponent(Math.abs(step)));
};
}
import exponent from "./exponent";
import precisionFixed from "./precisionFixed";
export default function(step, value) {
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
};
}

@@ -6,2 +6,2 @@ import exponent from "./exponent";

return Math.max(0, exponent(max) - exponent(step)) + 1;
};
}
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