SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Feb 6, 2009, 14:04 #1
- Join Date
- Feb 2007
- Posts
- 69
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Best field type for currency (price of a product)
Hello,
Just wondering what you guys the best SQL field type is to store a price?
I need to be able to display this price on a website and need to be able to order by it!
Just wondered what you guys would do?
Regards
Shaun
-
Feb 6, 2009, 14:16 #2
Take a look at http ://dev.mysql.com/doc/refman/5.0/en/numeric-types. html
-
Feb 6, 2009, 14:51 #3
-
Feb 7, 2009, 09:30 #4
- Join Date
- Feb 2007
- Posts
- 69
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
After reading through the link Mez provided I agree that Decimal would be the best!
But how do I display a decimal value as currency.
For example: 27995.00 needs to be displayed as £27,995.00!
Regards
Shaun
-
Feb 7, 2009, 09:54 #5
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
-
Feb 7, 2009, 10:00 #6
- Join Date
- Feb 2007
- Posts
- 69
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Great!
Thanks again for your help there!
Regards
Shaun
Bookmarks