monkey-style-guide 2.0.134 → 2.0.135

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.
@@ -229,6 +229,11 @@ class MonkeyUtils {
229
229
  .join('');
230
230
  return randomString;
231
231
  }
232
+ static handleOnlyNumbersCurrency(value) {
233
+ if (!value)
234
+ return null;
235
+ return value.replace(new RegExp(/[^0-9.]/g), '');
236
+ }
232
237
  static handleOnlyNumbers(value) {
233
238
  if (!value)
234
239
  return null;
@@ -3671,7 +3676,11 @@ class MonkeyInputComponent {
3671
3676
  else if (this.capitalize)
3672
3677
  return MonkeyUtils.capitalize(`${value}`.toUpperCase());
3673
3678
  else if (this.currency || this.percent) {
3674
- return MonkeyUtils.handleOnlyNumbers(`${value}`) / (apply ? 100 : 1);
3679
+ const handled = MonkeyUtils.handleOnlyNumbers(`${value}`);
3680
+ const result = handled / 100;
3681
+ if (!result)
3682
+ return '';
3683
+ return result.toFixed(2);
3675
3684
  }
3676
3685
  return value;
3677
3686
  }