samedi 25 juin 2016

decimal round wrong calculation

I have the sample following numbers which are stored in an mysql db in the decimal(10,2) format

1499.3927125506 - 1499.39 -> this is how it saved into the database
384.41295546559 - 384.41
278.74493927126 - 278.74
537.44939271255 - 537.45

The actual total before saving into the database is 1700, however after the saving the total becomes 1699.99

How can I make the total 1700 NOT 1699.99?

Aucun commentaire:

Enregistrer un commentaire