Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
18
node_modules/d3-format/src/formatGroup.js
generated
vendored
Normal file
18
node_modules/d3-format/src/formatGroup.js
generated
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
export default function(grouping, thousands) {
|
||||
return function(value, width) {
|
||||
var i = value.length,
|
||||
t = [],
|
||||
j = 0,
|
||||
g = grouping[0],
|
||||
length = 0;
|
||||
|
||||
while (i > 0 && g > 0) {
|
||||
if (length + g + 1 > width) g = Math.max(1, width - length);
|
||||
t.push(value.substring(i -= g, i + g));
|
||||
if ((length += g + 1) > width) break;
|
||||
g = grouping[j = (j + 1) % grouping.length];
|
||||
}
|
||||
|
||||
return t.reverse().join(thousands);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue