Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
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