© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
4 replies
Eric

How to make TextInput accept only 2 decimals

The price must only contain 2 decimals
Forms\Components\TextInput::make('price')
    ->numeric()
    ->inputMode('numeric')
    ->minValue(0.01)
    ->step(0.01)
    ->required()
    ->suffixIcon('heroicon-m-currency-euro')
,
Forms\Components\TextInput::make('price')
    ->numeric()
    ->inputMode('numeric')
    ->minValue(0.01)
    ->step(0.01)
    ->required()
    ->suffixIcon('heroicon-m-currency-euro')
,

But when i try it out, i can write several decimals.
What i am missing?
Screenshot_2024-03-13_at_12.22.18.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to make TextInput to allow only numbers without using numeric()
FilamentFFilament / ❓┊help
2y ago
How to enter only letters and numbers in TextInput?
FilamentFFilament / ❓┊help
2y ago
put 2 values in to one Textinput
FilamentFFilament / ❓┊help
3y ago