C# .NET - ROUNDDOWN() function in asp.net - Asked By Dom Afonso on 17-Jun-12 01:55 PM

How to use a ROUNDDOWN() function in asp.net?
kalpana aparnathi replied to Dom Afonso on 17-Jun-12 02:34 PM
hi,

for example :

double val1=1.9;

int val2=int.parse(val1);

Regards,
Vikram Singh Saini replied to Dom Afonso on 17-Jun-12 10:51 PM
I would recommend to use the Math.Ceiling() function as:

double dblValue = 123.45;
double roundOffValue = Math.Ceiling(dblValue);
Returns output as 124

Read more about same at http://msdn.microsoft.com/en-us/library/zx4t0t48.aspx
aneesa replied to Dom Afonso on 18-Jun-12 12:07 AM
Suppose you have a number '3.376'.
Now when you will use the RoundUp function you will get the result as '4.0'.
By using RoundDown function the result would be '3.0'.


However, for .NET you could use the Math.Floor and Math.Ceiling methods.
Jitendra Faye replied to Dom Afonso on 18-Jun-12 01:22 AM
refer this link-

http://forums.asp.net/t/1185888.aspx/1