I want to divide 0.01 cents by 4, the result is 0.0025 how to store in mysql?

Asked

Viewed 21 times

0

I want to divide 0.01 cents by 4, the result is 0.0025, I want to store this value in mysql which dataype I use in column?

  • use a type with decimals, such as decimal or float https://dev.mysql.com/doc/refman/8.0/en/numeric-types.html

  • 1

    If they are cents (currency), definitely do not use float, use decimal.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.