Skip to content

Commit

Permalink
Number: Add compact formatting compiler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rxaviers committed Jul 11, 2018
1 parent 474f3c6 commit dcfc396
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/compiler/cases/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ module.exports = {
return Globalize;
},
cases: function( Globalize ) {
var big = 99999999.99;
Globalize.locale( "en" );
return [
{ formatter: Globalize.numberFormatter(), args: [ Math.PI ] },
{ formatter: Globalize( "es" ).numberFormatter(), args: [ Math.PI ] },
{ formatter: Globalize( "ar" ).numberFormatter(), args: [ Math.PI ] },
{ formatter: Globalize( "zh-u-nu-native" ).numberFormatter(), args: [ Math.PI ] },
{ formatter: Globalize.numberFormatter(), args: [ 99999999.99 ] },
{ formatter: Globalize.numberFormatter(), args: [ big ] },

{ formatter: Globalize.numberFormatter( {
minimumIntegerDigits: 2,
Expand Down Expand Up @@ -51,10 +52,12 @@ module.exports = {
minimumSignificantDigits: 1,
maximumSignificantDigits: 3
} ), args: [ 0.00010001 ] },
{ formatter: Globalize.numberFormatter( { useGrouping: false } ), args: [ 99999999.99 ] },
{ formatter: Globalize.numberFormatter( { useGrouping: false } ), args: [ big ] },

{ formatter: Globalize.numberFormatter( { style: "percent" } ), args: [ Math.PI ] },
{ formatter: Globalize( "ar" ).numberFormatter( { style: "percent" } ), args: [ Math.PI ] }
{ formatter: Globalize( "ar" ).numberFormatter( { style: "percent" } ), args: [ Math.PI ] },
{ formatter: Globalize.numberFormatter( { compact: "short" } ), args: [ big ] },
{ formatter: Globalize.numberFormatter( { compact: "long" } ), args: [ big ] }
];
}
};

0 comments on commit dcfc396

Please sign in to comment.