# how to round up value from 2.4 to 3 ? [Answered]RSS

## 4 replies

Last post Feb 02, 2018 01:01 PM by wibowowiwit

• wibowowiwit

Member

51 Points

96 Posts

### how to round up value from 2.4 to 3 ?

Hi guys..

how to round value like below :

value =  2.7 result ---> 3
value =  2.5 result ---> 3
value =  2.1 result ---> 3

when the value have decimal value then it mus be round up..

Thanks & Regards.

• PatriceSc

All-Star

43540 Points

15174 Posts

### Re: how to round up value from 2.4 to 3 ?

Hi

Try Math.Ceiling(2.1)

• wibowowiwit

Member

51 Points

96 Posts

### Re: how to round up value from 2.4 to 3 ?

i have tried it .

Math.Ceiling(2.1) result ----> 2

how to make result is "3" not "2" ?

2.1 result---> "3"
2.2 result---> "3"
2.3 result---> "3"
2.4 result---> "3"
2.5 result---> "3"
2.6 result---> "3"
2.7 result---> "3"
2.8 result---> "3"
2.9 result---> "3"

• PatriceSc

All-Star

43540 Points

15174 Posts

### Re: how to round up value from 2.4 to 3 ?

Humm. You are 100 % sure ???

```using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(Math.Ceiling(2.1)); // Shows 3
}
}
}```

• wibowowiwit

Member

51 Points

96 Posts