flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
11
BACK_BACK/node_modules/d3-format/src/formatRounded.js
generated
vendored
Executable file
11
BACK_BACK/node_modules/d3-format/src/formatRounded.js
generated
vendored
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
import {formatDecimalParts} from "./formatDecimal.js";
|
||||
|
||||
export default function(x, p) {
|
||||
var d = formatDecimalParts(x, p);
|
||||
if (!d) return x + "";
|
||||
var coefficient = d[0],
|
||||
exponent = d[1];
|
||||
return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
|
||||
: coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
|
||||
: coefficient + new Array(exponent - coefficient.length + 2).join("0");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue