You are here: Re: float numbers « MsSQL Server « IT news, forums, messages
Re: float numbers

Posted by Tom Moreau on 04/03/06 18:16

Again, use SELECT:

select @seconds

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
..
<homa@havet.se> wrote in message
news:1144077300.519079.316740@t31g2000cwb.googlegroups.com...
Hi! Itried your code and it works fine in the example I gave but not
when I implement it in my code:

declare @x float(53)
declare @grades int
declare @minutes int
declare @seconds float(53)
declare @minwithrest float(53)
declare @leftover float(53)

select @x = 57.66602743
select @grades = floor(@x)
select @leftover = @x-@grades
select @minwithrest = (@leftover * 60)
select @minutes = floor(@minwithrest)
select @seconds = (@minwithrest - @minutes) * 60

print @grades
print @minutes
print @seconds


gives me 57.6987 as @seconds while it should be 57,698748

thanks!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация