2
I was reading about building RESTFUL API with Laravel, and I noticed an interesting flame that I once wondered if the way I always saved "money" in the database.
Is there a problem in saving as Double fields of type value?
The blog said, "Notice that price is an integer. PLEASE, I BEG YOU! NEVER STORE YOUR PRICE DATA AS DOUBLE!
ALWAYS STORE IT AS INTEGER!"
Reference: https://medium.com/@devlob/Creating-Apis-in-Laravel-5-5-using-api-Resources-9850c1b70efb
I think that answers: https://answall.com/questions/219211/qual-a-forma-correta-de-usar-os-tipos-float-double-e-decimal/219465#219465
– Inkeliz
Ok, that point on float/decimal, okay, but it says to use INTEGER... So...?
– Diego Ananias
A fixed point number (
decimal
) and a whole is the same thing.– Jefferson Quesado
@Hananiamizrahi, any further doubt, I believe that commenting on the answers to the other question can result in great replicas. Mainly in Maniero’s reply, his knowledge has no end (already mine I squeezed everything to write that answer)
– Jefferson Quesado