V4 Money Format TextInput?

I've noticed in V4, the existing code only renders values without decmials. For example:
TextInput::make('total_lump_sums')
->label('Total Lump Sums')
->columnSpan(2)
->mask(RawJs::make('$money($input)'))
->stripCharacters(',')
->formatStateUsing(fn ($state) => number_format((float) $state, 2))
->prefix('£')
->numeric(),
TextInput::make('total_lump_sums')
->label('Total Lump Sums')
->columnSpan(2)
->mask(RawJs::make('$money($input)'))
->stripCharacters(',')
->formatStateUsing(fn ($state) => number_format((float) $state, 2))
->prefix('£')
->numeric(),
did show as: 149859.65 now shows as: 149 We do have the MoneyCasts cast on this too as per v3 docs. Suggestions what's changed for this?
No description
No description
1 Reply
toeknee
toekneeOP2mo ago
narrowed it down to being format state and numeric clashing by the looks of it

Did you find this page helpful?