How to use TextInput with Mask and comma as decimalSeparator #6816
Replies: 5 comments 3 replies
-
Hello, that's way worked for me:
I hope it helps |
Beta Was this translation helpful? Give feedback.
-
Hi, is it possible to set |
Beta Was this translation helpful? Give feedback.
-
I found this and worked just fine for me: use Filament\Forms\Components\TextInput;
use Filament\Support\RawJs;
TextInput::make('price')
->mask(RawJs::make('$money($input)'))
->stripCharacters(',')
->numeric() |
Beta Was this translation helpful? Give feedback.
-
This help me! |
Beta Was this translation helpful? Give feedback.
-
try this logic for filamenphp V3 TextInput::make('amount') but when you need like 10.000.000,54 you need to dehydrate the data so it can be read as decimals like 10000000.54 is that so, you need to add something like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In the Netherlands, we are one of the lucky countries to use a comma as decimalSeparator... I'm unable to get this right in the TextInput field with a Mask.
The field is stored in the database as a unsiged decimal (8, 2) value and is being used to track the weight of a product. Eg. product has a weight of 200.00 kilograms.
Generates:

To clearify: It gives me the value of 20.000,00 instead of 200,00.
Also tried removing/changing the
mapToDecimalSeparator
, but no luck. Couldn't find any additional examples in the docs and also couldn't find any similar issues in GitHub/Google, so I must be missing something.Any help would be much appreciated 🙏
Beta Was this translation helpful? Give feedback.
All reactions