File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 1
1
import * as Plot from "@observablehq/plot" ;
2
2
import assert from "assert" ;
3
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
+
4
13
it ( "formatMonth(locale, format) does the right thing" , ( ) => {
5
14
assert . strictEqual ( Plot . formatMonth ( "en" , "long" ) ( 0 ) , "January" ) ;
6
15
assert . strictEqual ( Plot . formatMonth ( "en" , "short" ) ( 0 ) , "Jan" ) ;
You can’t perform that action at this time.
0 commit comments