Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

# C# Math.Something

### #1 Bobbydoo8 Posted 03 October 2006 - 08:58 AM

Bobbydoo8

Member

• Member
• 173 posts
I was searching around Math. , but could not find how to round to the multiple of 10.

Ex. 57 = 60 ..the multiple of 10 for 57 would be 60.

If anyone knows how to do this help would be greatly appreciated. If not I'll keep searching.....

• 0

### #2 darth_ash Posted 06 October 2006 - 06:26 AM

darth_ash

Member 1K

• Member
• 1,382 posts
Bobbydoo8,
Try:

```Math.Ceiling(x / 10D) * 10
```
where x is ur input.
• 0

### #3 Granz00 Posted 19 October 2006 - 01:28 AM

Granz00

Member

• Member
• 226 posts

Bobbydoo8,
Try:

```Math.Ceiling(x / 10D) * 10
```
where x is ur input.

That would always round your numbers up so instead do;

```x = Math::Round((x/10), 0) * 10;
```

• 0

### Similar Topics

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users