samedi 6 avril 2019

Laravel is returning double or float as integer

I have a model where i am saving ratings and datatype for rating is double. It is saving values in database in correct format for example 5.00 but when i fetch this it returns as 5(as integer) it returns correct for values like 5.10 or any other having effective value after decimal point but for values like 1.00, 2.00, 3.00 it returns only integer nothing after decimal point but i need everything exactly like it is saved in Database.

Already applied protected $cats array but no luck. Already using native driver.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire