Rounding numbers
Created at 06 Mar 2016, 00:31
GD
Rounding numbers
06 Mar 2016, 00:31
Is it possible to round decimal numbers, like (14.125) to integers (14), with a simple command, like in C-language there is the "round()" command?
Or do I need to code it with the volume-rounding? :P
Replies
GDPR-24_203122
06 Mar 2016, 10:59
RE:
cyfer said:
How to round decimal numbers in C# like you do in C language ?
Print(Math.Round(14.125,0)); //--> Returns a 14 in C#Print(Math.Round(14.935, 0)); //--> Returns 15and If you want to Round it so it has some decimal points you can specify that in the 2nd parameter of Round Method .
Thanx!
cyfer
06 Mar 2016, 01:47
How to round decimal numbers in C# like you do in C language ?
and If you want to Round it so it has some decimal points you can specify that in the 2nd parameter of Round Method .
@cyfer