mySQL data types

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

I've never had to use mySQL with anything that needed to accuracy as far as money.

I was wondering what data type others would recommend for storing currency values for best accuracy.

-Greg

druagord's picture

He has: 335 posts

Joined: May 2003

this will depend on how you treat decimal values for exemple DECIMAL(5,2) will store values from -99.99 to 999.99 5 being the total number of digit to keep (- count as a digit) and 2 being the number of digit after the dot

IF , ELSE , WHILE isn't that what life is all about

Busy's picture

He has: 6,151 posts

Joined: May 2001

another way is double(5,2) does the same as druagords

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.