diff --git a/js/components/text_input.js b/js/components/text_input.js index 0f99f899..506274a6 100644 --- a/js/components/text_input.js +++ b/js/components/text_input.js @@ -85,9 +85,6 @@ export default { }, onBlur: function(e) { - if (this.validation === 'dollars' && this.value === '$NaN') { - this.value = this.initialValue - } this._checkIfValid({ value: e.target.value, invalidate: true }) }, diff --git a/js/lib/dollars.js b/js/lib/dollars.js index 5ef65828..2085a0b5 100644 --- a/js/lib/dollars.js +++ b/js/lib/dollars.js @@ -5,6 +5,10 @@ export const formatDollars = (value, cents = true) => { currency: 'USD', }) } else if (typeof value === 'string') { + if (value === '') { + return value + } + return parseFloat(value).toLocaleString('us-US', { style: 'currency', currency: 'USD',