@rabex-kit/rabex-ui 0.1.8 → 0.1.9

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.
@@ -477,6 +477,17 @@ var _isDecimalValid = function isDecimalValid(val, dec) {
477
477
  var stringVal = val.toString();
478
478
  return stringVal.indexOf('.') >= 0 ? !(stringVal.split('.')[1].length > dec) : true;
479
479
  };
480
+ /**
481
+ * Prevent Scientific Notation
482
+ */
483
+ var _preventScientific = function preventScientific(num, digits, separator) {
484
+ var numString = typeof num === 'number' ? num.toString() : num;
485
+ // Check for scientific notation
486
+ if (numString.toLowerCase().includes('e')) {
487
+ return bigDecimal.getPrettyValue(numString, digits, separator);
488
+ }
489
+ return numString;
490
+ };
480
491
  var numberUtils = {
481
492
  delimiter: function delimiter(num, separator, separateBy) {
482
493
  return _delimiter(num, separator, separateBy);
@@ -496,6 +507,9 @@ var numberUtils = {
496
507
  toEn: function toEn(val) {
497
508
  return _toEn(val);
498
509
  },
510
+ preventScientific: function preventScientific(num) {
511
+ return _preventScientific(num);
512
+ },
499
513
  suffix: suffix,
500
514
  bigDecimal: bigDecimal,
501
515
  modulus: bigDecimal.modulus,