You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clamp min / max bounds when the configured bound is zero. The previous truthy check (if (opt.max)) silently no-op'd on 0 or "0", so configurations like max: 0 (cap positives, allow negatives) had no effect. Applied to both format() and unformat() so display and model stay in sync.
Clear the input on Backspace at the end position when allowBlank and treatZeroAsBlank are enabled, even without the .number model modifier. The directive's strict-equality check (unformat(...) === 0) failed when unformat() returned a string (e.g. "0.00"); the value is now coerced through parseFloat(String(...)) so the branch fires in both code paths.
Re-run the formatter after pressing + to flip a negative value's sign. The previous handler wrote String(number * -1) directly to el.value, dropping the prefix, thousands separator, and trailing precision zeros, and never dispatched a change event so the model never updated. The handler now strips the leading - and routes through setValue().
filterOptRestrictions() no longer throws when decimal, thousands, prefix, or suffix is passed as null, undefined, or a number through the bare directive (which bypasses Vue's prop validators). Non-string values are coerced to an empty string.
Corrected the typo "received and invalid format" to "received an invalid format" in the BigNumber constructor error message.
setCursor() re-checks document.activeElement inside its deferred Android-fix setTimeout so it no longer calls setSelectionRange() on an input the user has tabbed away from (which could move the caret on the now-focused field).
minimumNumberOfCharacters no longer corrupts negative values. padStart() was counting the leading - toward the target length, so format(-5, { minimumNumberOfCharacters: 5 }) produced 0-5.00 (sign in the middle of the digits). The sign is now stripped before padding and reattached after, treating minimumNumberOfCharacters as a digit count consistent with the positive case.
beforeUnmount no longer leaks event listeners when v-money3 is used on a non-<input> host (e.g. a wrapper <div> containing an <input>). mounted() reassigned its local el to the inner input and attached listeners there, but beforeUnmount() received the original host and nulled handlers on the wrong node. The inner input is now stashed on the host so beforeUnmount() clears listeners on the same element they were registered on.
format() no longer throws BigNumber has received an invalid format for the constructor: N. when called with a negative precision. The numbersToCurrency() call inside format() received the raw opt.precision, while every other site routed it through fixed(); a negative value produced a trailing-dot string that BigNumber then rejected. Precision is now clamped once at the top of format() and reused at every call site.
The Money3 component now reconciles its parent's v-model when the initial modelValue can't be coerced to a number (e.g. '-' with disableNegative=true and the .number modifier, or other non-numeric strings). Previously setup() ran Number(modelValue).toFixed(...) which yielded the literal string 'NaN'; format() then defensively rendered '0.00', leaving the displayed value sanitized but the parent's modelValue stuck at the original garbage. An onMounted() hook now emits update:model-value once with the sanitized number so source-of-truth matches the rendered view. Transient negative-typing state ('-' with disableNegative=false) is unaffected because both sides resolve to NaN and the reconcile check skips.
Masked mode (masked=true without the .number modifier) now reconciles the parent's v-model when a format-affecting prop changes at runtime. change() emits the formatted string verbatim in this mode, so the parent's modelValue is a non-numeric string like "1,234.56". reformatOnOptsChange() would recompute the display under the new opts (e.g. switching precision from 2 to 3 reinterpreted the digits as "123.456") but its !Number.isNaN(a) guard early-returned before any emit, leaving the parent stuck on the old formatted string. The watcher now branches on the emit shape: in masked + non-.number mode it emits the new formatted string whenever it differs from the current modelValue, matching change()'s semantics.
format() and the component setup path no longer throw RangeError: toFixed() digits argument must be between 0 and 100 when precision exceeds 100. fixed() previously clamped to 1000, but every Number.prototype.toFixed(p) call site (format.ts lines 38/40/43 and component.vue line 172) is capped at 100 by the ECMAScript spec. fixed() is now clamped to [0, 100], and the two precision + 1 truncate-without-round paths additionally Math.min(..., 100) to handle the edge where precision = 100 would yield 101. Custom-precision paths (BigNumber.toFixed, numbersToCurrency) are unaffected because they only ever see clamped values.
BigNumber.toFixed(precision, shouldRound=false) no longer leaves a trailing . on the returned string when truncating to precision 0. string.slice(0, diff) cut the digits but kept the separator, so new BigNumber('1.5').toFixed(0, false) returned '1.' instead of '1'. format() masked this via joinIntegerAndDecimal()'s falsy-empty guard, but direct callers saw the malformed number. The trailing dot is now stripped after the slice.
BigNumber.adjustComparisonNumbers() now uses instanceof BigNumber instead of constructor.name === 'BigNumber' to detect already-constructed operands. Under minification (or any build that renames the class), the name check failed and the method tried to re-wrap the operand via new BigNumber(<BigNumber instance>), which fell through to setupString() and threw TypeError: string.replace is not a function. lessThan / biggerThan / isEqual between two BigNumber operands now survive minified builds.
disableNegative is now enforced after the min / max clamp in both format() and unformat(). The sign-stripping at parse time guaranteed a non-negative BigNumber, but a negative max (or min) re-introduced negativity via bigNumber.setNumber(opt.max) — so format(10, { disableNegative: true, max: -5 }) rendered '-5.00', contradicting the "no negative output" contract. A trailing if (opt.disableNegative && bigNumber.lessThan(0)) bigNumber.setNumber(0) re-clamps to zero so the invariant holds end-to-end.