Hi,
Can i store a percentage value as float or decimal? What is the difference?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Nov 3, 2011, 5:34 AM
VulpesPosted Nov 4, 2011, 6:04 AM
If you do, how are you making the conversion?
Nethra R SPosted Nov 4, 2011, 12:43 AM
As you said i am saving percentage values and the datatype declared for that is decimal(3,2) but when a user enters 10.3 for example it gives an error saying cannot convert varchar to decimal
Pravin MorePosted Nov 3, 2011, 5:57 AM
Hi Nethra,
float data type is known as approximate data types.Approximate numeric data types do not store the exact values specified for many numbers they store an extremely close approximation of the value.do not use float when exact numeric behavior is required, such as in financial applications,
so decimal is perfect.
Thanks,
Pravin.