Answers for "c sharp round double to nearest 0.5"

C#
1

round double c#

double a = 5.3124;
a = Math.Round(a, 2);
//a is now equal to 5.31
Posted by: Guest on August-14-2020
0

c# round to closest multiple

int value = 30;
int factor = 16;
int nearestMultiple = 
        (int)Math.Round(
             (value / (double)factor),
             MidpointRounding.AwayFromZero
         ) * factor;
Posted by: Guest on March-12-2020

C# Answers by Framework

Browse Popular Code Answers by Language