@sis-cc/dotstatsuite-components 21.8.0 → 21.9.0

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.
@@ -30,7 +30,7 @@ import getISOWeek from "date-fns/get_iso_week";
30
30
  import makeStyles from "@mui/styles/makeStyles";
31
31
  import { useTheme } from "@mui/material/styles";
32
32
  const name = "@sis-cc/dotstatsuite-components";
33
- const version = "21.8.0";
33
+ const version = "21.9.0";
34
34
  const meta = {
35
35
  name,
36
36
  version
@@ -4421,9 +4421,17 @@ const formatValue = (observation, formatAttributesIndexes, attributes) => {
4421
4421
  const formatSeparator = (value2) => numeral(value2).format(`0,0.[0000000]`);
4422
4422
  const formatDecimals = ifElse(
4423
4423
  always(isValidNumber$1(decimals)),
4424
- (value2) => numeral(value2).format(
4425
- ifElse(equals(0), always("0,0"), (d) => `0,0.${join("", times(always("0"), d))}`)(decimals)
4426
- ),
4424
+ (v) => {
4425
+ const num = Number(v);
4426
+ const isTiny = Math.abs(num) < Math.pow(10, -(decimals ?? 2) + 1);
4427
+ const displayNum = isTiny ? 0 : num;
4428
+ const decimalFormat = ifElse(
4429
+ equals(0),
4430
+ always("0,0"),
4431
+ (d) => `0,0.${join("", times(always("0"), d))}`
4432
+ )(decimals ?? 2);
4433
+ return numeral(displayNum).format(decimalFormat);
4434
+ },
4427
4435
  formatSeparator
4428
4436
  );
4429
4437
  return ifElse(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-components",
3
3
  "description": "Set components based on React.",
4
- "version": "21.8.0",
4
+ "version": "21.9.0",
5
5
  "type": "module",
6
6
  "module": "./dist/dotstatsuite-components.js",
7
7
  "files": [