Round up 10th of Decimal

  • Thread starter Thread starter Magus
  • Start date Start date
M

Magus

I have 3 numbers that I want to round up to the nearest 10th of a decimal.

9.31318 --> 9.4
8.237935 --> 8.3
2.80162 --> 2.9

I can't figure out how to round up though. I've tried Math.Ceiling but it's only returning the Integer. I'm probably overlooking something very simple, but I would appreciate any help.

Thanks!
 
I have 3 numbers that I want to round up to the nearest 10th of a decimal..

9.31318  --> 9.4
8.237935 --> 8.3
2.80162  --> 2.9

I can't figure out how to round up though. I've tried Math.Ceiling but it's only returning the Integer. I'm probably overlooking something very simple, but I would appreciate any help.

Thanks!

Not sure what you want but:

Math.Round(x, 1);

Math.Ceiling(x*10)/10;

This should at least give a hint of the options
 
Back
Top