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
  • 44,811
  • 17
  • 103
  • 137
Helping Hands
  • 5,292
  • 9
  • 60
  • 127

1 Answers1

4

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

fubo
  • 44,811
  • 17
  • 103
  • 137
gilliduck
  • 2,762
  • 2
  • 16
  • 32