I did all the due diligence I could and I found some answers in python, c++, php and JavaScript that didn't quite solve my problem...
In C#
I am trying to round up the value of the 2nd decimal point to the nearest value that is divisible by 10.
I have a double value z
= 14.066666
I need to turn z
into 14.10
This is what I've done so far:
var result1 = Math.Ceiling(z); // 15 (want 14.10)
var result2 = Math.Round(z,2); // 14.7 (want 14.10)
var result3 = Math.Round(z,5); // 14.0667 (want 14.10)
var result4 = Math.Ceiling(z*100)/100.0; // 14.07 (want 14.10)
var result5 = Math.Ceiling(z*10)/10 // 14.1 (want 14.10)
Grateful for your consideration and thankful for any help that comes my way.