Make sure the price looks like $110,000 and not $110000
I have to display like $110,000 and not like $110000. How to design the table field.If take price field as int then it will not take value 110,000 and if I take it as varchar then it will take as 110,000 but then how i will perform the mathematical function like 110,000*2 or 110,000+500.
number_format()
(In other words, store it as an INT or possibly DECIMAL in the DB table, and let PHP handle the formatting when outputting it to the user.)
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks