July 12, 2005 at 12:27 pm
When I try tp store .02 in my database table column which has a real datatype, its storing 1.9999999552965164E-2. But how can store it .02 instead of 1.9999999552965164E-2. Its because when I give this value to my front end programmer they are truncating it to one decimal and showing it as .019 which is a wrong value we are showing than the collected value .02 .So is there any way I can restrict storing it to .02 than 1.9999999552965164E-2.
Any ideas would be greatly appreciated.
Thanks.
July 12, 2005 at 12:32 pm
Use decimal(18,2) instead.
July 12, 2005 at 12:33 pm
From BOL: Float and real
Approximate number data types for use with floating point numeric data. Floating point data is approximate; not all values in the data type range can be precisely represented.
Solution :
Use Decimal!!
* Noel
July 12, 2005 at 12:39 pm
Dam! keep typing faster than me
* Noel
July 12, 2005 at 12:41 pm
Yup.. but your solution is more detailed... so I'll let it slide this time .
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply