nfr Posted February 27, 2006 Share Posted February 27, 2006 Hello -I am trying to build a small accounting system using php/mySQL. What datatypes should I use to store amounts, i.e. monetary values? Also, how can I format the amounts so that they are presented as €xx.yy and not €xx.y if the y value is 40 cents for example?Regards,Neil. Quote Link to comment https://forums.phpfreaks.com/topic/3670-math-datatypes-for-currency/ Share on other sites More sharing options...
litebearer Posted February 27, 2006 Share Posted February 27, 2006 This might help as regards formatting[a href=\"http://us2.php.net/money_format\" target=\"_blank\"]http://us2.php.net/money_format[/a]and here for data types[a href=\"http://www.htmlite.com/mysql003.php\" target=\"_blank\"]http://www.htmlite.com/mysql003.php[/a]Hope it helps.Lite... Quote Link to comment https://forums.phpfreaks.com/topic/3670-math-datatypes-for-currency/#findComment-12708 Share on other sites More sharing options...
obsidian Posted February 27, 2006 Share Posted February 27, 2006 as for datatypes in the DB, FLOAT(6,2) usually works quite well for me, but i don't typically use anything with HUGE numbers, so you may want to increase that a bit for your needs. Quote Link to comment https://forums.phpfreaks.com/topic/3670-math-datatypes-for-currency/#findComment-12709 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.