Skip to content

Commit 2e24cf9

Browse files
committed
Use µ rather than μ.
That is, MICRO SIGN (\xb5) rather than GREEK SMALL LETTER MU (\u03bc).
1 parent 3dcdfbf commit 2e24cf9

5 files changed

Lines changed: 21 additions & 13 deletions

File tree

d3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@
656656
return t.reverse().join(d3_format_thousandsSeparator || "") + f;
657657
};
658658
}
659-
var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "μ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix);
659+
var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix);
660660
d3.formatPrefix = function(value, precision) {
661661
var i = 0;
662662
if (value) {

d3.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/formatPrefix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var d3_formatPrefixes = ["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(d3_formatPrefix);
1+
var d3_formatPrefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(d3_formatPrefix);
22

33
d3.formatPrefix = function(value, precision) {
44
var i = 0;

test/core/format-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ suite.addBatch({
8080
assert.strictEqual(f(1000), "1k");
8181
assert.strictEqual(f(1400), "1.4k");
8282
assert.strictEqual(f(1500.5), "1.5005k");
83-
assert.strictEqual(f(.000001), "");
83+
assert.strictEqual(f(.000001), "");
8484
},
8585
"can output SI prefix notation with appropriate rounding": function(format) {
8686
var f = format(".3s");
@@ -95,7 +95,7 @@ suite.addBatch({
9595
assert.strictEqual(f(145500000), "146M");
9696
assert.strictEqual(f(145999999.999999347), "146M");
9797
assert.strictEqual(f(1e26), "100Y");
98-
assert.strictEqual(f(.000001), "1.00μ");
98+
assert.strictEqual(f(.000001), "1.00µ");
9999
assert.strictEqual(f(.009995), "0.0100");
100100
var f = format(".4s");
101101
assert.strictEqual(f(999.5), "999.5");

test/core/formatPrefix-test.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ suite.addBatch({
1818
assert.equal(prefix(1e-03).symbol, "m");
1919
assert.equal(prefix(1e-04).symbol, "m");
2020
assert.equal(prefix(1e-05).symbol, "m");
21-
assert.equal(prefix(1e-06).symbol, "μ");
22-
assert.equal(prefix(1e-07).symbol, "μ");
23-
assert.equal(prefix(1e-08).symbol, "μ");
21+
assert.equal(prefix(1e-06).symbol, "µ");
22+
assert.equal(prefix(1e-07).symbol, "µ");
23+
assert.equal(prefix(1e-08).symbol, "µ");
2424
assert.equal(prefix(1e-09).symbol, "n");
2525
assert.equal(prefix(1e-10).symbol, "n");
2626
assert.equal(prefix(1e-11).symbol, "n");
@@ -76,7 +76,7 @@ suite.addBatch({
7676
assert.equal(prefix(-0).symbol, "");
7777
assert.equal(prefix(-1e-00).symbol, "");
7878
assert.equal(prefix(-1e-03).symbol, "m");
79-
assert.equal(prefix(-1e-06).symbol, "μ");
79+
assert.equal(prefix(-1e-06).symbol, "µ");
8080
assert.equal(prefix(-1e-09).symbol, "n");
8181
assert.equal(prefix(-1e-12).symbol, "p");
8282
assert.equal(prefix(-1e-15).symbol, "f");
@@ -96,10 +96,18 @@ suite.addBatch({
9696
assert.equal(prefix(-1e27).symbol, "Y");
9797
},
9898
"considers the effect of rounding based on precision": function(prefix) {
99-
assert.equal(prefix(999.5, 3).symbol, "k");
100-
assert.equal(prefix(999.5, 4).symbol, "");
101-
assert.equal(prefix(.009995, 3).symbol, "");
102-
assert.equal(prefix(.009995, 4).symbol, "m");
99+
assert.equal(prefix(999.5000000, 4).symbol, "");
100+
assert.equal(prefix(999.5000000, 3).symbol, "k");
101+
assert.equal(prefix(995.0000000, 3).symbol, "");
102+
assert.equal(prefix(995.0000000, 2).symbol, "k");
103+
assert.equal(prefix(950.0000000, 2).symbol, "");
104+
assert.equal(prefix(950.0000000, 1).symbol, "k");
105+
assert.equal(prefix(0.000009995, 4).symbol, "µ");
106+
assert.equal(prefix(0.000009995, 3).symbol, "m");
107+
assert.equal(prefix(0.000009950, 3).symbol, "µ");
108+
assert.equal(prefix(0.000009950, 2).symbol, "m");
109+
assert.equal(prefix(0.000009500, 2).symbol, "µ");
110+
assert.equal(prefix(0.000009500, 1).symbol, "m");
103111
}
104112
}
105113
});

0 commit comments

Comments
 (0)