c# round to closest multiple
int value = 30;
int factor = 16;
int nearestMultiple =
(int)Math.Round(
(value / (double)factor),
MidpointRounding.AwayFromZero
) * factor;
Also in C#:
- array copy c#
- inheritance in c#
- c sharp tryparse
- unity set material color
- add row and columns to grid wpf in code
- unity print
- c# datetime dd/mm/yyy hh:mm:ss
- c# multiple catch exceptions
- rotate object towards target rotation slowly unity
- asp.net core allow all origins
- c# clone stream
- c# trim string
- c# inheritance constructor
- c# return multiple value unity
- how to detected WindowCloseEvent in other window wpf
- can't add an editor script
- c# store generic type without arguments
- string format comma c#
- c# function
- run async method parallel c#
- dynamic group by expression C#
- change textbox location C#
- asp.net core task iactionresult