Hi,
I am not understanding whether i should declare selling price in that sql table as money,decimal or int.. Which one is appropriate?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 1, 2011, 9:03 PM EDT
i told you it in example......
for e.g
moneyresult numericresult
2949.00 2949.8525
see,if you use money then you will get 2949.00 not 2949.8525 so its wrong.and if you loose .8 in every calculation then guess how much price will reduce if you are using that value in thousand number of time.......
Thanks, hopw i am able clear my point.
Pravin.
Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 1, 2011, 8:21 PM EDT
int is not proper and dont use money also it is not perfect type to hold price, use decimal for price its perfect.
money and decimal result will be same till decimal point only,so money is not good for further calculations.
for e.g
moneyresult numericresult
2949.00 2949.8525
So, use decimal only.
Thanks,
Pravin.
Nethra R SRank #6,347 · 269 reputationPosted Nov 1, 2011, 8:27 PM EDT
Thanks for the reply. If you can further explain how it can cause problem further i will be grateful
Nethra R SRank #6,347 · 269 reputationPosted Nov 1, 2011, 10:26 PM EDT