June 11, 2011 at 4:45 pm
Hi. i do a shopping site and i need to keep products' price. Which data type do i use? i think to use money. But decimal can be used . Wihch one is gain performance or be suitable?
Thanks.
June 11, 2011 at 9:16 pm
You can use either. I typically use decimal.
With respect to performance. You will not see a significant difference, if any, between the two.
Money types provide display formatting options that decimals don't use but that should be handled by the client program anyway.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
June 13, 2011 at 12:22 am
Money data type can store upto .0001 in terms of monetary value. However this might not work especially for cases where the currency is so devalued that it takes more than .0001 to effectively represent the value.
e.g 1 Zimbabwe dollar is .0026... USD, this imagine doing a running total of this and take into account rounding errors and you get the idea.
Decimal is a safe bet always over money
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply