Tuesday, December 14, 2010

Rounding to the nearest # in C#.NET

This simple code lets you round to the nearest nth number. In this example it rounds to the nearest 5th.


double free = 100 - (Math.Round(free2 / 5.0) * 5);
            

No comments:

Post a Comment

Generating "Always On Top" NSWindow in macOS across all detected displays

Also: Using UIKit & Cocoa Frameworks using Objective-C In m acOS or OS X , written in either Objective-C or Swift  Langues, you m...