@gisce/react-ooui 1.2.0-rc.44 → 1.2.0-rc.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.2.0-rc.44",
3
+ "version": "1.2.0-rc.45",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -1,6 +1,6 @@
1
1
  const formatter = (graphType: "pie" | "default" | "barGrouped") => {
2
2
  return (object: any) => {
3
- const formattedValue = object.value.toLocaleString("en-US", {
3
+ const formattedValue = object.value.toLocaleString("es-ES", {
4
4
  useGrouping: true,
5
5
  });
6
6
  const name = graphType === "pie" ? object.x : object.type;
@@ -273,7 +273,11 @@ function CommonIndicator({
273
273
  ? minFontSize
274
274
  : height * fontGrowFactor;
275
275
 
276
- let finalValue = total ? `${value}/${total}` : `${value}`;
276
+ const localeValue = value?.toLocaleString("es-ES", {
277
+ useGrouping: true,
278
+ });
279
+
280
+ let finalValue = total ? `${localeValue}/${total}` : `${localeValue}`;
277
281
 
278
282
  if (suffix) {
279
283
  finalValue += " " + suffix;
@@ -342,13 +346,23 @@ function PercentageIndicator({
342
346
  ? minFontSize
343
347
  : twoLinesHeight * fontGrowFactor;
344
348
 
345
- let finalValue = total ? `${value}/${total}` : `${value}`;
349
+ const localeValue = value?.toLocaleString("es-ES", {
350
+ useGrouping: true,
351
+ });
352
+
353
+ let finalValue = total
354
+ ? `${localeValue}/${total?.toLocaleString("es-ES", {
355
+ useGrouping: true,
356
+ })}`
357
+ : `${localeValue}`;
346
358
 
347
359
  if (suffix) {
348
360
  finalValue += " " + suffix;
349
361
  }
350
362
 
351
- const percentValue = `${percent}%`;
363
+ const percentValue = `${percent?.toLocaleString("es-ES", {
364
+ useGrouping: true,
365
+ })}%`;
352
366
 
353
367
  let tw = getTextWidth(
354
368
  percentValue,