Cents on DB how to show in money?

I have a column "price" datatype INT I'm storing my prices in cents, eg: 1658460 My form looks like this:
Forms\Components\TextInput::make('price')
->mask(fn (Forms\Components\TextInput\Mask $mask) => $mask->money(prefix: '£', thousandsSeparator: ',', decimalPlaces: 2, isSigned: false))
->required(),
Forms\Components\TextInput::make('price')
->mask(fn (Forms\Components\TextInput\Mask $mask) => $mask->money(prefix: '£', thousandsSeparator: ',', decimalPlaces: 2, isSigned: false))
->required(),
How can I have my form show £16,584.60 and not £1,658,460.00, somewhere I need to divide the price by 100, where/how? Thanks.
1 Reply
Want results from more Discord servers?
Add your server