I am trying to round up decimal numbers towards positive infinity in C# .Net Standard 2.1 library using Math.Round()
function with MidpointRounding.ToPositiveInfinity
enum as its mode parameter but I don't know why it doesn't exist in the MidpointRounding enum. the same enum value (ToPositiveInfinity
) exists when the project is using .net 5.
Code
Math.Round(2.336, 2, MidpointRounding.ToPositiveInfinity);
Does anyone know how I can fix this?