I am looking to round a double to any arbitrary digit to right or left of the decimal point.
Math.Round
only works for digits to the right of the decimal point, and I need to be able to round to values the nearest 10s, 100s, 1000s, ...
Example of desired inputs/outputs:
Round(1234.56789, 0) == 1235
Round(1234.56789, -3) == 1234.568
Round(1234.56789, 3) == 1000
This problem differs from Round double in two decimal places in C#?
because I need to round values to positions to the left of the decimal point such as 1,2345,000
rounding to the nearest 10,000