nova-money-field icon indicating copy to clipboard operation
nova-money-field copied to clipboard

Saving issue losing 1 cent in a specific situation

Open flatcapco opened this issue 4 months ago • 0 comments

Hi, thanks for the package, I've noticed an issue where the value passed to the Models Observer saving() method is 1 cent lower than the passed value.

This is using EUR, and storedInMinorUnits

Passing the following values: 17.49 18.49 19.49

Using 17.49 as the input Results in the $model->price returning 17.48 even though the correct value 17.49 is saved in the database.

I only spotted this as I had a test setup to watch if my other column "total" was lower than the price value as my total is using the 17.48 value so ends up being 1 cent less than expected.

A bit bizarre but I'm guessing its an issue with the underlying money logic?

Package version 2.0 Nova version 4.32.11 Laravel version 10.42

Thanks Alex

flatcapco avatar Feb 14 '24 07:02 flatcapco