Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi,


In one of my database table i am used decimal datatype to store weights and distence.

I specified datatype and range like bellow:

decimal(18,3)

i want to store three degits after decimal point for example if user enters 8393892.89828 for that i want store like 8393892.898.But in my tabel data is storing like 8393892.000 only.

Please anybody explain me what my be the reson and how to solve this one.

Thanks
Uday
Posted
Comments
Prerak Patel 24-Oct-11 5:35am    
How do you store? Share some code.

1 solution

When I try it in a simple test, it works fine:
SQL
INSERT into myTable (dist) VALUES (123.456 ) , ( 8393892.89828)
Where "dist" is decimal(18,3)
I get the values:
123.456
8393892.898

So, it must be your code to insert it - what are you doing to insert these values?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900