Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Float Value

Author  Topic 

Kotti
Posting Yak Master

129 Posts

Posted - 2008-12-20 : 03:36:01
Hi Friends,

i am trying to save Float=0.03 in to the datebase.But it was Saving the value as float= 0.0299999993294477.

How can i save the value as float=0.03

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2008-12-21 : 02:02:41
use precision.

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2008-12-22 : 00:56:38
declare @str decimal(18,2)
set @str = 0.0299999993294477
select @str
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-22 : 01:00:21
Do not use the float data type where accuracy matters.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -