sag_components 1.0.969 → 1.0.970

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.
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isNumericValue = exports.getNumberWithCommas = exports.getFormattedValue = exports.getFormattedUnits = exports.getCurrencySign = void 0;
7
+ /* eslint-disable no-restricted-globals */
8
+ /* eslint-disable no-shadow */
7
9
  const getCurrencySign = (currencyTypeToConvert, value) => {
8
10
  if (value === undefined || value === null) {
9
11
  return '';
10
12
  }
11
- // eslint-disable-next-line no-restricted-globals
12
13
  if (isNaN(parseFloat(value))) {
13
14
  return '';
14
15
  }
@@ -26,7 +27,6 @@ const getFormattedUnits = num => {
26
27
  if (num === undefined || num === null) {
27
28
  return '';
28
29
  }
29
- // eslint-disable-next-line no-restricted-globals
30
30
  if (isNaN(parseFloat(num))) {
31
31
  return '';
32
32
  }
@@ -43,15 +43,13 @@ const getFormattedUnits = num => {
43
43
  };
44
44
  exports.getFormattedUnits = getFormattedUnits;
45
45
  const getFormattedValue = num => {
46
- if (num === undefined || num === null) {
47
- return null;
48
- }
49
- // eslint-disable-next-line no-restricted-globals
50
- if (isNaN(parseFloat(num))) {
46
+ const value = num !== null && num !== void 0 ? num : 0;
47
+ if (isNaN(parseFloat(value))) {
51
48
  return null;
52
49
  }
53
50
  const formatNumber = value => {
54
- const fixedValue = value.toFixed(1);
51
+ const numValue = Number(value);
52
+ const fixedValue = numValue.toFixed(1);
55
53
  return fixedValue.endsWith('.0') ? fixedValue.slice(0, -2) : fixedValue;
56
54
  };
57
55
  if (Math.abs(num) >= 1000000000) {
@@ -77,7 +75,6 @@ const isNumericValue = num => {
77
75
  if (num === undefined || num === null) {
78
76
  return false;
79
77
  }
80
- // eslint-disable-next-line no-restricted-globals
81
78
  if (isNaN(parseFloat(num))) {
82
79
  return false;
83
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.969",
3
+ "version": "1.0.970",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {