Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# round to closest multiple

int value = 30;
int factor = 16;
int nearestMultiple = 
        (int)Math.Round(
             (value / (double)factor),
             MidpointRounding.AwayFromZero
         ) * factor;
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# structure 
Csharp :: unity c# move transform 
Csharp :: unity reflect raycast 
Csharp :: unity get max occurrence in list 
Csharp :: unity ui button 
Csharp :: finding keys in the registry 
Csharp :: iframe set html content c# 
Csharp :: Disable Debug.log Unity 
Csharp :: player input manager join manually 
Csharp :: onmousedown not working unity 
Csharp :: how to return a value in c# 
Csharp :: string interpolation in c# 
Csharp :: C# 1 minute delay 
Csharp :: how to cut a string in c# 
Csharp :: iterate through photon player gameobjects 
Csharp :: sharepoint c# get list item query by lookup 
Csharp :: how to write text in specific position in c# 
Csharp :: asp c# page scroll position change after postback 
Csharp :: c# filter datagridview 
Csharp :: eventsource web api c# 
Csharp :: unity collision.impulse 
Csharp :: adding additional parameter to form submit 
Csharp :: access label from another class c# 
Csharp :: how to call an If statement only once in C# 
Csharp :: how to make a system to check if i see certain object in unity 
Csharp :: c# unit test exception using try catch 
Csharp :: textbox gotfocus wpf 
Csharp :: How to get selected item from Dropdown in GridView 
Csharp :: unity GUI TextField enter 
Csharp :: c# faker 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =