[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Ruslan

8/3/2003 11:26:00 AM

How can I round up a float number?



For example:

If I have a number 3.6 I want to obtain 4 and

If I have a number 3.1 also to obtain 4



Thanks a lot.



Ruslan


2 Answers

Jay B. Harlow [MVP - Outlook]

8/3/2003 1:37:00 PM

0

Ruslan,
Have you tried System.Math.Ceiling? Which returns the smallest whole number
greater than or equal to the specified number.

Note for negative numbers it will return numbers closer to zero.

Ceiling(-3.6) will return -3.

The function System.Match.Floor will return the smallest whole number less
than or equal to the specified number.

Hope this helps
Jay

"Ruslan" <ruslan_albu@hotmail.com> wrote in message
news:%236eF3GbWDHA.2384@TK2MSFTNGP10.phx.gbl...
> How can I round up a float number?
>
>
>
> For example:
>
> If I have a number 3.6 I want to obtain 4 and
>
> If I have a number 3.1 also to obtain 4
>
>
>
> Thanks a lot.
>
>
>
> Ruslan
>
>


Ruslan

8/4/2003 7:11:00 AM

0

Thanks, Jay



It helped me.



Ruslan



"Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> wrote in message
news:#QccDRcWDHA.1872@TK2MSFTNGP12.phx.gbl...
> Ruslan,
> Have you tried System.Math.Ceiling? Which returns the smallest whole
number
> greater than or equal to the specified number.
>
> Note for negative numbers it will return numbers closer to zero.
>
> Ceiling(-3.6) will return -3.
>
> The function System.Match.Floor will return the smallest whole number less
> than or equal to the specified number.
>
> Hope this helps
> Jay
>
> "Ruslan" <ruslan_albu@hotmail.com> wrote in message
> news:%236eF3GbWDHA.2384@TK2MSFTNGP10.phx.gbl...
> > How can I round up a float number?
> >
> >
> >
> > For example:
> >
> > If I have a number 3.6 I want to obtain 4 and
> >
> > If I have a number 3.1 also to obtain 4
> >
> >
> >
> > Thanks a lot.
> >
> >
> >
> > Ruslan
> >
> >
>
>