By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,419 Members | 1,636 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,419 IT Pros & Developers. It's quick & easy.

Value Truncates When Using Float Datatype

P: 48
Hi all,

Below is my query which truncates the value of the float variable. I have no clue why it truncates. Can anyone help me out?


Declare @myValue Float
set @myValue = 0.00456456676577567
Print @myValue


Thanks,
Aads
Sep 5 '08 #1
Share this Question
Share on Google+
2 Replies


ck9663
Expert 2.5K+
P: 2,878
Can you use decimal instead of float?

Expand|Select|Wrap|Line Numbers
  1. Declare @myValue decimal(20,20)
  2. set @myValue = 0.00456456676577567
  3. Print @myValue
  4.  
-- CK
Sep 5 '08 #2

P: 48
Yeah I can use decimal instead of float. Thanks a lot! It works!


Regards,
Aads
Sep 8 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.