@brightspace-ui/intl
Advanced tools
Comparing version 3.4.0 to 3.5.0
@@ -8,5 +8,9 @@ import { | ||
function formatPositiveInteger(value, descriptor) { | ||
function formatPositiveInteger(value, descriptor, useGrouping) { | ||
value = Math.floor(value); | ||
if (!useGrouping) { | ||
return value.toString(); | ||
} | ||
const valueStr = '' + value; | ||
@@ -51,2 +55,3 @@ let ret = ''; | ||
options.useGrouping = options.useGrouping !== false; | ||
if (options.style !== 'decimal' && options.style !== 'percent') { | ||
@@ -197,3 +202,3 @@ options.style = 'decimal'; | ||
let ret = formatPositiveInteger(parseInt(strValue), descriptor); | ||
let ret = formatPositiveInteger(parseInt(strValue), descriptor, options.useGrouping); | ||
@@ -200,0 +205,0 @@ const decimalIndex = strValue.indexOf('.'); |
{ | ||
"name": "@brightspace-ui/intl", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"description": "Internationalization APIs for number, date, time and file size formatting and parsing in D2L Brightspace.", | ||
@@ -5,0 +5,0 @@ "main": "lib/number.js", |
@@ -45,2 +45,3 @@ # intl | ||
- **maximumFractionDigits**: Maximum number of fraction digits to use. Possible values range from `0` to `20`; the default is the larger of `minimumFractionDigits` and `3`. | ||
- **useGrouping**: Whether to use grouping separators, such as thousands separators; the default is `true`. | ||
@@ -47,0 +48,0 @@ Formatting as an integer (rounded to 0 decimal places): |
68879
1541
265