We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27ec3b8 commit 17ed038Copy full SHA for 17ed038
test/marks/format-test.js
@@ -1,6 +1,15 @@
1
import * as Plot from "@observablehq/plot";
2
import assert from "assert";
3
4
+it("formatNumber(locale) does the right thing", () => {
5
+ assert.strictEqual(Plot.formatNumber()(Math.PI), "3.142");
6
+ assert.strictEqual(Plot.formatNumber()(12345), "12,345");
7
+ assert.strictEqual(Plot.formatNumber("en")(Math.PI), "3.142");
8
+ assert.strictEqual(Plot.formatNumber("en")(12345), "12,345");
9
+ assert.strictEqual(Plot.formatNumber("fr")(Math.PI), "3,142");
10
+ assert.strictEqual(Plot.formatNumber("fr")(12345), "12\u202f345");
11
+});
12
+
13
it("formatMonth(locale, format) does the right thing", () => {
14
assert.strictEqual(Plot.formatMonth("en", "long")(0), "January");
15
assert.strictEqual(Plot.formatMonth("en", "short")(0), "Jan");
0 commit comments