-3

I'm trying to round the following number as follows:

6.89 <- dollars and cents

I need to use this number in calculations rounded down to the nearest 10c.
Therefore I need: 6.80

To clarify I need a way to obtain the following example results:

1.32 --> 1.30  
1.55 --> 1.50  
6.89 --> 6.80  

I can't seen how this can be done with Round or Floor.

Peanut
  • 18,967
  • 20
  • 72
  • 78

1 Answers1

2

Just use this, I don't see any error with that, and works well with your examples.

Math.Floor (number*10)/10

user 12321
  • 2,846
  • 1
  • 24
  • 34
  • use this in case you want to make it a string at the end, string myString = myInt.ToString(); – user 12321 Jan 27 '15 at 16:27
  • Thank you for your answer. So many people attack ... and the dup questions aren't even dup. This site has become so poor – Peanut Jan 27 '15 at 16:35