Problem with decimal format (EUR) (,)
Hello im using this mask function to format the input field to give me the exact format how i want it.
this is working fine, but the problem is when i save it.
The database has a decimal field.
if i save the field [1st picture]
1500
and the 2nd picture is after i saved it
150.000
I know this has to do with the formatting but i couldnt found a way to fix this, can anyone help me.
Solution:Jump to solution
```
protected function MaximumPriceExcVat(): Attribute
{
return Attribute::make(
get: fn ($value) => price($value,2),...
11 Replies
Yes EUR format for mask in v2 doesn’t work. This is a known issue.
The mask in v2 has a lot of issues
oh alright
is there a way to manipulate the data before the form is submitting it?
maybe i can change it
Dehydration is the process which gets data from fields, and transforms it. TextInput::make('name')->dehydrateStateUsing(fn ($state) => ucwords($state))
No probably not because the data has to be numeric
I tried this many times in v2
But if you find a way let me know
The data will be submitted correctly it’s just the formatting for the mask that’s wrong
Hi guys, im still stuck with this problem
i found this method
but it doesnt change anything for me
this is in my model
can i use the get/set attribute magic functions?
im trying to use this
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
nevermind
i fixed it
in the model i use this
Solution
@Andrew Wallo found a way, i put the solution above this reply
Hmm okay thanks