Closed danielreales7 closed 1 year ago
If I delete the casting that I created the TextColumn works fine for me:
TextColumn::make('price')->label('Precio')->currency('EUR')
but TextInput
have the same error in console. I'm testing in Chrome
@danielreales7, can you create a public repo that reproduces this bug so I can investigate the problem?
@ariaieboy https://github.com/danielreales7/test-filament-currency I create a new project for this with a seeder.
Thank you so much for your help!
@ariaieboy I was doing some testing, and of course, the input is of integer type, so when applying replaceAll, it gives that error. In case it were a string, it would work correctly. I made this example:
init(){ let formattedNumber = (this.input / 100).toLocaleString('es-ES'); this.masked = formattedNumber.replaceAll('.','$decimalSeparator'); \$watch('masked',()=>this.updateInput()); },
And it works correctly.
@danielreales7 test version 1.1.2, the problem should be fixed
Hi @ariaieboy
I'm getting same error:
replaceAll
for number input it's not possible.
Hi @ariaieboy
I'm getting same error:
replaceAll
for number input it's not possible.
can you test it in your repo and reproduce this error on that? https://github.com/danielreales7/test-filament-currency
What happened?
I am working with a TextInput where I want to display the price in EUR, and the value coming from the database is of integer type. When I apply ->currencyMask(thousandSeparator: '.', decimalSeparator: ',', precision: 2), it gives me an error in the console:
I'm using this casting:
https://filamentphp.com/docs/3.x/panels/getting-started#casting-the-price-to-an-integer
How to reproduce the bug
TextInput::make('price') ->required() ->numeric() ->suffix('€') ->currencyMask(thousandSeparator: '.',decimalSeparator: ',',precision: 2)
Package Version
1.1.1
PHP Version
8.1
Laravel Version
10.10
Which operating systems does with happen with?
macOS
Notes
No response