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.4.1 to 0.4.2

src/locale/cs-CZ.js

2

build/bundle.js

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

var version = "0.4.1"; export * from "../index"; export {version};
var version = "0.4.2"; export * from "../index"; export {version};

@@ -298,2 +298,9 @@ (function (global, factory) {

var csCZ = locale({
decimal: ",",
thousands: "\xa0",
grouping: [3],
currency: ["", "\xa0Kč"],
});
var deCH = locale({

@@ -448,3 +455,4 @@ decimal: ",",

function precisionRound(step, max) {
return Math.max(0, exponent(Math.abs(max)) - exponent(Math.abs(step))) + 1;
step = Math.abs(step), max = Math.abs(max) - step;
return Math.max(0, exponent(max) - exponent(step)) + 1;
};

@@ -455,3 +463,3 @@

var version = "0.4.1";
var version = "0.4.2";

@@ -463,2 +471,3 @@ exports.version = version;

exports.localeCaEs = caES;
exports.localeCsCz = csCZ;
exports.localeDeCh = deCH;

@@ -465,0 +474,0 @@ exports.localeDeDe = deDE;

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

!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define("d3-format",["exports"],r):r(n.d3_format={})}(this,function(n){"use strict";function r(n,r){if((t=(n=r?n.toExponential(r-1):n.toExponential()).indexOf("e"))<0)return null;var t,e=n.slice(0,t);return[e.length>1?e[0]+e.slice(2):e,+n.slice(t+1)]}function t(n){return n=r(Math.abs(n)),n?n[1]:NaN}function e(n,r){return function(t,e){for(var i=t.length,o=[],a=0,c=n[0],u=0;i>0&&c>0&&(u+c+1>e&&(c=Math.max(1,e-u)),o.push(t.substring(i-=c,i+c)),!((u+=c+1)>e));)c=n[a=(a+1)%n.length];return o.reverse().join(r)}}function i(n,t){var e=r(n,t);if(!e)return n+"";var i=e[0],o=e[1],a=o-(d=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,c=i.length;return a===c?i:a>c?i+new Array(a-c+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+r(n,Math.max(0,t+a-1))[0]}function o(n,t){var e=r(n,t);if(!e)return n+"";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(n,r){n=n.toPrecision(r);n:for(var t,e=n.length,i=1,o=-1;e>i;++i)switch(n[i]){case".":o=t=i;break;case"0":0===o&&(o=i),t=i;break;case"e":break n;default:o>0&&(o=0)}return o>0?n.slice(0,o)+n.slice(t+1):n}function c(n){return new u(n)}function u(n){if(!(r=p.exec(n)))throw new Error("invalid format: "+n);var r,t=r[1]||" ",e=r[2]||">",i=r[3]||"-",o=r[4]||"",a=!!r[5],c=r[6]&&+r[6],u=!!r[7],s=r[8]&&+r[8].slice(1),l=r[9]||"";"n"===l?(u=!0,l="g"):m[l]||(l=""),(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=c,this.comma=u,this.precision=s,this.type=l}function s(n){return n}function l(n){function r(n){n=c(n);var r=n.fill,t=n.align,e=n.sign,i=n.symbol,s=n.zero,l=n.width,h=n.comma,f=n.precision,g=n.type,p="$"===i?a[0]:"#"===i&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",M="$"===i?a[1]:/[%p]/.test(g)?"%":"",x=m[g],v=!g||/[defgprs%]/.test(g);return f=null==f?g?6:12:/[gprs]/.test(g)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),function(n){var i=p,a=M;if("c"===g)a=x(n)+a,n="";else{n=+n;var c=(0>n||0>1/n)&&(n*=-1,!0);if(n=x(n,f),c){var m,b=-1,w=n.length;for(c=!1;++b<w;)if(m=n.charCodeAt(b),m>48&&58>m||"x"===g&&m>96&&103>m||"X"===g&&m>64&&71>m){c=!0;break}}if(i=(c?"("===e?e:"-":"-"===e||"("===e?"":e)+i,a=a+("s"===g?y[8+d/3]:"")+(c&&"("===e?")":""),v)for(var m,b=-1,w=n.length;++b<w;)if(m=n.charCodeAt(b),48>m||m>57){a=(46===m?u+n.slice(b+1):n.slice(b))+a,n=n.slice(0,b);break}}h&&!s&&(n=o(n,1/0));var E=i.length+n.length+a.length,C=l>E?new Array(l-E+1).join(r):"";switch(h&&s&&(n=o(C+n,C.length?l-a.length:1/0),C=""),t){case"<":return i+n+a+C;case"=":return i+C+n+a;case"^":return C.slice(0,E=C.length>>1)+i+n+a+C.slice(E)}return C+i+n+a}}function i(n,e){var i=r((n=c(n),n.type="f",n)),o=3*Math.max(-8,Math.min(8,Math.floor(t(e)/3))),a=Math.pow(10,-o),u=y[8+o/3];return function(n){return i(a*n)+u}}var o=n.grouping&&n.thousands?e(n.grouping,n.thousands):s,a=n.currency,u=n.decimal;return{format:r,formatPrefix:i}}function h(n){return Math.max(0,-t(Math.abs(n)))}function f(n,r){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(t(r)/3)))-t(Math.abs(n)))}function g(n,r){return Math.max(0,t(Math.abs(r))-t(Math.abs(n)))+1}var d,m={"":a,"%":function(n,r){return(100*n).toFixed(r)},b:function(n){return Math.round(n).toString(2)},c:function(n){return n+""},d:function(n){return Math.round(n).toString(10)},e:function(n,r){return n.toExponential(r)},f:function(n,r){return n.toFixed(r)},g:function(n,r){return n.toPrecision(r)},o:function(n){return Math.round(n).toString(8)},p:function(n,r){return o(100*n,r)},r:o,s:i,X:function(n){return Math.round(n).toString(16).toUpperCase()},x:function(n){return Math.round(n).toString(16)}},p=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;u.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=l({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),x=l({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),v=l({decimal:",",thousands:"'",grouping:[3],currency:[""," CHF"]}),b=l({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),w=l({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),E=l({decimal:".",thousands:",",grouping:[3],currency:["£",""]}),C=l({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),F=l({decimal:",",thousands:" ",grouping:[3],currency:[""," €"]}),P=l({decimal:",",thousands:" ",grouping:[3],currency:["","$"]}),S=l({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),k=l({decimal:".",thousands:",",grouping:[3],currency:["₪",""]}),$=l({decimal:",",thousands:" ",grouping:[3],currency:[""," Ft"]}),j=l({decimal:",",thousands:".",grouping:[3],currency:["€",""]}),A=l({decimal:".",thousands:",",grouping:[3],currency:["","円"]}),z=l({decimal:".",thousands:",",grouping:[3],currency:["₩",""]}),H=l({decimal:",",thousands:".",grouping:[3],currency:[""," ден."]}),N=l({decimal:",",thousands:".",grouping:[3],currency:["€ ",""]}),R=l({decimal:",",thousands:".",grouping:[3],currency:["","zł"]}),D=l({decimal:",",thousands:".",grouping:[3],currency:["R$",""]}),I=l({decimal:",",thousands:" ",grouping:[3],currency:[""," руб."]}),K=l({decimal:",",thousands:" ",grouping:[3],currency:["","SEK"]}),X=l({decimal:".",thousands:",",grouping:[3],currency:["¥",""]}),G=M.format,J=M.formatPrefix,U="0.4.1";n.version=U,n.format=G,n.formatPrefix=J,n.locale=l,n.localeCaEs=x,n.localeDeCh=v,n.localeDeDe=b,n.localeEnCa=w,n.localeEnGb=E,n.localeEnUs=M,n.localeEsEs=C,n.localeFiFi=F,n.localeFrCa=P,n.localeFrFr=S,n.localeHeIl=k,n.localeHuHu=$,n.localeItIt=j,n.localeJaJp=A,n.localeKoKr=z,n.localeMkMk=H,n.localeNlNl=N,n.localePlPl=R,n.localePtBr=D,n.localeRuRu=I,n.localeSvSe=K,n.localeZhCn=X,n.formatSpecifier=c,n.precisionFixed=h,n.precisionPrefix=f,n.precisionRound=g});
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define("d3-format",["exports"],r):r(n.d3_format={})}(this,function(n){"use strict";function r(n,r){if((t=(n=r?n.toExponential(r-1):n.toExponential()).indexOf("e"))<0)return null;var t,e=n.slice(0,t);return[e.length>1?e[0]+e.slice(2):e,+n.slice(t+1)]}function t(n){return n=r(Math.abs(n)),n?n[1]:NaN}function e(n,r){return function(t,e){for(var i=t.length,o=[],a=0,c=n[0],u=0;i>0&&c>0&&(u+c+1>e&&(c=Math.max(1,e-u)),o.push(t.substring(i-=c,i+c)),!((u+=c+1)>e));)c=n[a=(a+1)%n.length];return o.reverse().join(r)}}function i(n,t){var e=r(n,t);if(!e)return n+"";var i=e[0],o=e[1],a=o-(f=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,c=i.length;return a===c?i:a>c?i+new Array(a-c+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+r(n,Math.max(0,t+a-1))[0]}function o(n,t){var e=r(n,t);if(!e)return n+"";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(n,r){n=n.toPrecision(r);n:for(var t,e=n.length,i=1,o=-1;e>i;++i)switch(n[i]){case".":o=t=i;break;case"0":0===o&&(o=i),t=i;break;case"e":break n;default:o>0&&(o=0)}return o>0?n.slice(0,o)+n.slice(t+1):n}function c(n){return new u(n)}function u(n){if(!(r=p.exec(n)))throw new Error("invalid format: "+n);var r,t=r[1]||" ",e=r[2]||">",i=r[3]||"-",o=r[4]||"",a=!!r[5],c=r[6]&&+r[6],u=!!r[7],s=r[8]&&+r[8].slice(1),l=r[9]||"";"n"===l?(u=!0,l="g"):m[l]||(l=""),(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=c,this.comma=u,this.precision=s,this.type=l}function s(n){return n}function l(n){function r(n){n=c(n);var r=n.fill,t=n.align,e=n.sign,i=n.symbol,s=n.zero,l=n.width,h=n.comma,g=n.precision,d=n.type,p="$"===i?a[0]:"#"===i&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",M="$"===i?a[1]:/[%p]/.test(d)?"%":"",x=m[d],v=!d||/[defgprs%]/.test(d);return g=null==g?d?6:12:/[gprs]/.test(d)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),function(n){var i=p,a=M;if("c"===d)a=x(n)+a,n="";else{n=+n;var c=(0>n||0>1/n)&&(n*=-1,!0);if(n=x(n,g),c){var m,b=-1,w=n.length;for(c=!1;++b<w;)if(m=n.charCodeAt(b),m>48&&58>m||"x"===d&&m>96&&103>m||"X"===d&&m>64&&71>m){c=!0;break}}if(i=(c?"("===e?e:"-":"-"===e||"("===e?"":e)+i,a=a+("s"===d?y[8+f/3]:"")+(c&&"("===e?")":""),v)for(var m,b=-1,w=n.length;++b<w;)if(m=n.charCodeAt(b),48>m||m>57){a=(46===m?u+n.slice(b+1):n.slice(b))+a,n=n.slice(0,b);break}}h&&!s&&(n=o(n,1/0));var C=i.length+n.length+a.length,E=l>C?new Array(l-C+1).join(r):"";switch(h&&s&&(n=o(E+n,E.length?l-a.length:1/0),E=""),t){case"<":return i+n+a+E;case"=":return i+E+n+a;case"^":return E.slice(0,C=E.length>>1)+i+n+a+E.slice(C)}return E+i+n+a}}function i(n,e){var i=r((n=c(n),n.type="f",n)),o=3*Math.max(-8,Math.min(8,Math.floor(t(e)/3))),a=Math.pow(10,-o),u=y[8+o/3];return function(n){return i(a*n)+u}}var o=n.grouping&&n.thousands?e(n.grouping,n.thousands):s,a=n.currency,u=n.decimal;return{format:r,formatPrefix:i}}function h(n){return Math.max(0,-t(Math.abs(n)))}function g(n,r){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(t(r)/3)))-t(Math.abs(n)))}function d(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,t(r)-t(n))+1}var f,m={"":a,"%":function(n,r){return(100*n).toFixed(r)},b:function(n){return Math.round(n).toString(2)},c:function(n){return n+""},d:function(n){return Math.round(n).toString(10)},e:function(n,r){return n.toExponential(r)},f:function(n,r){return n.toFixed(r)},g:function(n,r){return n.toPrecision(r)},o:function(n){return Math.round(n).toString(8)},p:function(n,r){return o(100*n,r)},r:o,s:i,X:function(n){return Math.round(n).toString(16).toUpperCase()},x:function(n){return Math.round(n).toString(16)}},p=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;u.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=l({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),x=l({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),v=l({decimal:",",thousands:" ",grouping:[3],currency:[""," Kč"]}),b=l({decimal:",",thousands:"'",grouping:[3],currency:[""," CHF"]}),w=l({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),C=l({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),E=l({decimal:".",thousands:",",grouping:[3],currency:["£",""]}),F=l({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),P=l({decimal:",",thousands:" ",grouping:[3],currency:[""," €"]}),S=l({decimal:",",thousands:" ",grouping:[3],currency:["","$"]}),k=l({decimal:",",thousands:".",grouping:[3],currency:[""," €"]}),$=l({decimal:".",thousands:",",grouping:[3],currency:["₪",""]}),j=l({decimal:",",thousands:" ",grouping:[3],currency:[""," Ft"]}),z=l({decimal:",",thousands:".",grouping:[3],currency:["€",""]}),A=l({decimal:".",thousands:",",grouping:[3],currency:["","円"]}),H=l({decimal:".",thousands:",",grouping:[3],currency:["₩",""]}),K=l({decimal:",",thousands:".",grouping:[3],currency:[""," ден."]}),N=l({decimal:",",thousands:".",grouping:[3],currency:["€ ",""]}),R=l({decimal:",",thousands:".",grouping:[3],currency:["","zł"]}),D=l({decimal:",",thousands:".",grouping:[3],currency:["R$",""]}),I=l({decimal:",",thousands:" ",grouping:[3],currency:[""," руб."]}),X=l({decimal:",",thousands:" ",grouping:[3],currency:["","SEK"]}),G=l({decimal:".",thousands:",",grouping:[3],currency:["¥",""]}),J=M.format,U=M.formatPrefix,Z="0.4.2";n.version=Z,n.format=J,n.formatPrefix=U,n.locale=l,n.localeCaEs=x,n.localeCsCz=v,n.localeDeCh=b,n.localeDeDe=w,n.localeEnCa=C,n.localeEnGb=E,n.localeEnUs=M,n.localeEsEs=F,n.localeFiFi=P,n.localeFrCa=S,n.localeFrFr=k,n.localeHeIl=$,n.localeHuHu=j,n.localeItIt=z,n.localeJaJp=A,n.localeKoKr=H,n.localeMkMk=K,n.localeNlNl=N,n.localePlPl=R,n.localePtBr=D,n.localeRuRu=I,n.localeSvSe=X,n.localeZhCn=G,n.formatSpecifier=c,n.precisionFixed=h,n.precisionPrefix=g,n.precisionRound=d});
import defaultLocale from "./src/locale/en-US";
export {default as locale} from "./src/locale";
export {default as localeCaEs} from "./src/locale/ca-ES";
export {default as localeCsCz} from "./src/locale/cs-CZ";
export {default as localeDeCh} from "./src/locale/de-CH";

@@ -5,0 +6,0 @@ export {default as localeDeDe} from "./src/locale/de-DE";

{
"name": "d3-format",
"version": "0.4.1",
"version": "0.4.2",
"description": "Format numbers for human consumption.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -296,2 +296,6 @@ # d3-format

<a name="localeCsCz" href="#localeCsCz">#</a> d3_format.<b>localeCsCz</b>
[Czech (Czech Republic)](https://github.com/d3/d3-format/tree/master/src/locale/cs-CZ.js)
<a name="localeDeCh" href="#localeDeCh">#</a> d3_format.<b>localeDeCh</b>

@@ -298,0 +302,0 @@

import exponent from "./exponent";
export default function(step, max) {
return Math.max(0, exponent(Math.abs(max)) - exponent(Math.abs(step))) + 1;
step = Math.abs(step), max = Math.abs(max) - step;
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