sag_components 1.0.555 → 1.0.556

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.
@@ -56,9 +56,6 @@ const getFormattedValue = num => {
56
56
  if (Math.abs(num) >= 1000) {
57
57
  return (num / 1000).toFixed(1).replace(/\.0$/, "");
58
58
  }
59
- if (num && num % 1 != 0) {
60
- return num === null || num === void 0 ? void 0 : num.toFixed(2);
61
- }
62
59
  return num;
63
60
  };
64
61
  exports.getFormattedValue = getFormattedValue;
@@ -34,7 +34,17 @@ const TotalDoughnutChart = props => {
34
34
  const [DoughnutChartRadius, setDoughnutChartRadius] = (0, _react.useState)(0);
35
35
  const [zoomResolution, setZoomResolution] = (0, _react.useState)(1);
36
36
  const DoughnutChartContainerRef = (0, _react.useRef)();
37
- const dotCutTrenty = row => dotCut ? (0, _CommonFunctions.getFormattedValue)(row.value) : (0, _CommonFunctions.getNumberWithCommas)(row.value);
37
+ const dotCutTrenty = row => {
38
+ if (!row || !row.value) return 0;
39
+ let value = 0;
40
+ if (row !== null && row !== void 0 && row.value && Math.abs(row.value) > 0 && row.value % 1 != 0) {
41
+ var _row$value;
42
+ value = row === null || row === void 0 ? void 0 : (_row$value = row.value) === null || _row$value === void 0 ? void 0 : _row$value.toFixed(2);
43
+ } else {
44
+ value = row === null || row === void 0 ? void 0 : row.value;
45
+ }
46
+ return dotCut ? (0, _CommonFunctions.getFormattedValue)(value) : (0, _CommonFunctions.getNumberWithCommas)(value);
47
+ };
38
48
  (0, _react.useEffect)(() => {
39
49
  const handleResize = () => {
40
50
  setZoomResolution(window.devicePixelRatio);
@@ -101,7 +111,7 @@ const TotalDoughnutChart = props => {
101
111
  width: width
102
112
  }, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.CurrencySign, {
103
113
  id: "CurrencySign"
104
- }, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, value) : ""), dotCut ? (0, _CommonFunctions.getFormattedValue)(value) : (0, _CommonFunctions.getNumberWithCommas)(value), dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : ""), addingBenchmark && /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, null))), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartAndLegendContainer, {
114
+ }, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, value) : ""), dotCut ? (0, _CommonFunctions.getFormattedValue)(value && Math.abs(value) > 0 && value % 1 != 0 ? value === null || value === void 0 ? void 0 : value.toFixed(2) : value) : (0, _CommonFunctions.getNumberWithCommas)(value), dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : ""), addingBenchmark && /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, null))), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartAndLegendContainer, {
105
115
  id: "DoughnutChartAndLegendContainer"
106
116
  }, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartContainer, {
107
117
  id: "DoughnutChartContainer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.555",
3
+ "version": "1.0.556",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {