0
double number1 = 4.1870418700000007d;

I tried with following :

Input : Math.Ceiling(number1) Output : 5

Input : Math.Round(number1) Output : 4

I want output : 4.19

fubo
  • 42,334
  • 17
  • 98
  • 130
Helping Hands
  • 5,003
  • 6
  • 55
  • 117

1 Answers1

4

You're close, it's Math.Round(number1, 2). It takes an overload that accepts the number of decimal places.

fubo
  • 42,334
  • 17
  • 98
  • 130
gilliduck
  • 2,229
  • 1
  • 15
  • 28