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 11import * as Plot from "@observablehq/plot" ;
22import assert from "assert" ;
33
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+
413it ( "formatMonth(locale, format) does the right thing" , ( ) => {
514 assert . strictEqual ( Plot . formatMonth ( "en" , "long" ) ( 0 ) , "January" ) ;
615 assert . strictEqual ( Plot . formatMonth ( "en" , "short" ) ( 0 ) , "Jan" ) ;
You can’t perform that action at this time.
0 commit comments