File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -659,6 +659,45 @@ describe('n', () => {
659
659
expect ( n ( 0.99 , { key : 'percent' , fallbackWarn : false } ) ) . toEqual ( '99%' )
660
660
} )
661
661
662
+ test ( 'minimumFractionDigits, maximumFractionDigits' , ( ) => {
663
+ const { n } = createComposer ( {
664
+ locale : 'US' ,
665
+ fallbackLocale : [ 'ja-JP' ] ,
666
+ numberFormats : {
667
+ US : {
668
+ currency : {
669
+ style : 'currency' ,
670
+ currency : 'USD' ,
671
+ minimumFractionDigits : 0 ,
672
+ maximumFractionDigits : 2
673
+ } ,
674
+ decimal : {
675
+ style : 'decimal' ,
676
+ currency : 'USD' ,
677
+ minimumFractionDigits : 0 ,
678
+ maximumFractionDigits : 2
679
+ }
680
+ } ,
681
+ 'ja-JP' : {
682
+ currency : {
683
+ style : 'currency' ,
684
+ currency : 'JPY' /*, currencyDisplay: 'symbol'*/
685
+ } ,
686
+ numeric : {
687
+ style : 'decimal' ,
688
+ useGrouping : false
689
+ } ,
690
+ percent : {
691
+ style : 'percent' ,
692
+ useGrouping : false
693
+ }
694
+ }
695
+ }
696
+ } )
697
+ expect ( n ( 0.99 , { key : 'currency' , fallbackWarn : false } ) ) . toEqual ( '$0.99' )
698
+ expect ( n ( 1.1111 , { key : 'decimal' , fallbackWarn : false } ) ) . toEqual ( '1.11' )
699
+ } )
700
+
662
701
test ( 'missing' , ( ) => {
663
702
const { n } = createComposer ( {
664
703
locale : 'en-US' ,
You can’t perform that action at this time.
0 commit comments