What's the equivalent of Delphi's RoundTo() in C#?
I am not very familiar with Delphi and I am aware of C#'s Math.Round()
but am not sure how equivalent they are. Math.Round()
has several overloads and RoundTo()
has two.
What's the equivalent of Delphi's RoundTo() in C#?
I am not very familiar with Delphi and I am aware of C#'s Math.Round()
but am not sure how equivalent they are. Math.Round()
has several overloads and RoundTo()
has two.
The equivalent method is Math.Round
. You need to use the overload which offers the functionality that you need, whatever that is.
The Delphi RoundTo
function is not overloaded and is best matched with this overload of Math.Round
:
public static double Round(
double value,
int digits
)