import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
export var padTrimValue = function padTrimValue(value) {
  var decimalSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
  var decimalScale = arguments.length > 2 ? arguments[2] : undefined;
  if (decimalScale === undefined || value === '' || value === undefined) {
    return value;
  }
  if (!value.match(/\d/g)) {
    return '';
  }
  var _value$split = value.split(decimalSeparator),
    _value$split2 = _slicedToArray(_value$split, 2),
    _int = _value$split2[0],
    decimals = _value$split2[1];
  if (decimalScale === 0) {
    return _int;
  }
  var newValue = decimals || '';
  if (newValue.length < decimalScale) {
    while (newValue.length < decimalScale) {
      newValue += '0';
    }
  } else {
    newValue = newValue.slice(0, decimalScale);
  }
  return "".concat(_int).concat(decimalSeparator).concat(newValue);
};