Skip to content

Commit

Permalink
Merge pull request #393 from vuelessjs/VL_Fix-input-money-cents-issue…
Browse files Browse the repository at this point in the history
…_Dmytro-Holdobin

VL_Fix-input-money-cents-issue_Dmytro-Holdobin
  • Loading branch information
Explicit12 authored Feb 19, 2025
2 parents b2d795b + 915ce7d commit 40c89ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui.form-input-money/useFormatCurrency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,13 @@ export default function useFormatCurrency(
0,
options.value.maxFractionDigits,
);
const actualMinFractionDigits = options.value.minFractionDigits
? options.value.minFractionDigits
: currentFraction.length;

const newFormattedValue = getFormattedValue(newRawValue, {
...options.value,
minFractionDigits: currentFraction.length,
minFractionDigits: actualMinFractionDigits,
});

if (Number.isNaN(newFormattedValue) || newFormattedValue.includes("NaN")) {
Expand Down

0 comments on commit 40c89ea

Please sign in to comment.