Jump to content

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
Photo

C# Math.Something


  • Please log in to reply

#1
Bobbydoo8

Bobbydoo8

    Member

  • Member
  • PipPipPip
  • 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.....

:whistling:
  • 0

Advertisements


#2
darth_ash

darth_ash

    Member 1K

  • Member
  • PipPipPipPip
  • 1,382 posts
Bobbydoo8,
Try:

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

#3
Granz00

Granz00

    Member

  • Member
  • PipPipPip
  • 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

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP