| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c30de85 commit ab58439
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,8 +99,18 @@ if (!common.hasIntl) { | |||
| 99 | 99 | assert.strictEqual(localeString, '1/1/1970, 12:00:00 AM'); | |
| 100 | 100 | } | |
| 101 | 101 | // number format | |
| 102 | - const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890); | ||
| 103 | - assert.strictEqual(numberFormat, '12,345.679'); | ||
| 102 | + { | ||
| 103 | + const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890); | ||
| 104 | + assert.strictEqual(numberFormat, '12,345.679'); | ||
| 105 | + } | ||
| 106 | + // Significant Digits | ||
| 107 | + { | ||
| 108 | + const loc = ['en-US']; | ||
| 109 | + const opts = { maximumSignificantDigits: 4 }; | ||
| 110 | + const num = 10.001; | ||
| 111 | + const numberFormat = new Intl.NumberFormat(loc, opts).format(num); | ||
| 112 | + assert.strictEqual(numberFormat, '10'); | ||
| 113 | + } | ||
| 104 | 114 | ||
| 105 | 115 | const collOpts = { sensitivity: 'base', ignorePunctuation: true }; | |
| 106 | 116 | const coll = new Intl.Collator(['en'], collOpts); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments