RoundUp to the next multiple of .5

J

James A. Fortune

Lele said:
Unless it already produces a multiple of .5, I need the results of my
expression to round up to the nearest multiple of 1/2 or .5, therefore if I
was dividing 5/2 I would want the result of my roundup function to leave the
result at 2.5 However, if I was dividing 5 by 1.5 I would want the roundup
function to change the 3.33 to 3.5

Thanks for any and all help

Using the idea from:

http://groups.google.com/group/microsoft.public.access/msg/9614be58d0485dd0

-0.5 * Int(-2# * X)

James A. Fortune
(e-mail address removed)

C# Specifications:
1.2 & 2.0:
http://msdn2.microsoft.com/en-us/library/ms228593.aspx
3.0:
http://msdn.microsoft.com/vstudio/reference/default.aspx?pull=/library/en-us/dnvs05/html/cs3spec.asp

C# Reference:
The C# programming Language
ISBN: 0321154916
Publisher: Addison-Wesley Professional
Authors: Anders Hejlsberg, Scott Wiltamuth, Peter Golde
Copyright: 2003 672 pp.
 
J

James A. Fortune

James said:
C# Reference:
The C# programming Language
ISBN: 0321154916
Publisher: Addison-Wesley Professional
Authors: Anders Hejlsberg, Scott Wiltamuth, Peter Golde
Copyright: 2003 672 pp.

I recently bought this book, but the second edition, June 2006, ISBN
0-321-33443-4

The blurb in the back recommended the Microsoft .NET Development series:

http://www.awprofessional.com/series/series.asp?st=44116&rl=1

James A. Fortune
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top