We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello!
If you use MoneyIntegerCast on your model, e.g.:
MoneyIntegerCast
protected $casts = [ 'price' => MoneyIntegerCast::class . ':GBP', ];
and given the form:
<form action="somewhere" method="post"> @csrf <input type="number" step="0.01" /> </form>
If you enter in the value 1 into the form, expecting £1.00 to be result. You get £0.01 instead...
1
£1.00
£0.01
However, if you enter 1.00 into the form, expecting £1.00 to be result. You do get £1.00.
1.00
My users keep putting in 1 and expecting £1.00...
The text was updated successfully, but these errors were encountered:
If you set $forceDecimals to true, this presents a new problem.
$forceDecimals
true
It fixes the above issue, entering 1 does indeed save as £1.00.
However, reading the value back out of the database sets it to £100...
£100
Sorry, something went wrong.
No branches or pull requests
Hello!
If you use
MoneyIntegerCast
on your model, e.g.:and given the form:
If you enter in the value
1
into the form, expecting£1.00
to be result. You get£0.01
instead...However, if you enter
1.00
into the form, expecting£1.00
to be result. You do get£1.00
.My users keep putting in
1
and expecting£1.00
...The text was updated successfully, but these errors were encountered: