intelicoreact 1.1.5 → 1.1.6

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.
@@ -80,6 +80,9 @@ var intlNumbersFormatter = function intlNumbersFormatter(inputValue) {
80
80
  var quantity = fractionDigits.quantity,
81
81
  _fractionDigits$isRen = fractionDigits.isRenderAlways,
82
82
  isRenderAlways = _fractionDigits$isRen === void 0 ? false : _fractionDigits$isRen;
83
+ var dotIndex = inputValue === null || inputValue === void 0 ? void 0 : inputValue.indexOf('.');
84
+ var afterDot = dotIndex !== -1 ? inputValue.slice(dotIndex + 1) : '';
85
+ var minimumFractionDigits = afterDot && lastSym !== '.' ? inputValue.slice(dotIndex).length - 1 : isRenderAlways ? quantity : 0;
83
86
  var priceSettings = {
84
87
  useGrouping: useGrouping,
85
88
  //группировка разрядов
@@ -90,7 +93,7 @@ var intlNumbersFormatter = function intlNumbersFormatter(inputValue) {
90
93
  currencyDisplay: currencyDisplay,
91
94
  //валюта в виде символа
92
95
  //минимально не надо отображать центы, если их нет, иначе всегда будет .00
93
- minimumFractionDigits: isRenderAlways ? quantity : 0,
96
+ minimumFractionDigits: minimumFractionDigits,
94
97
  maximumFractionDigits: quantity //максимально отображать 2 цифры после запятой, если центы всё же есть
95
98
 
96
99
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [