Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
ASP .Net
Re: rounding values to the nearest 5 or 10
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="=?ISO-8859-1?Q?G=F6ran_Andersson?=, post: 883935"] hi there, Divide the value by five, round it to the nearest integer, then multiply it by five. Example: double x = 147.24 int y = (int)Math.Round(x / 5.0) * 5; (This will of course round the number to 145, not 150 as you used in your example.) [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
ASP .Net
Re: rounding values to the nearest 5 or 10
Top