Round to nearest 0.05

Hi,

how would I go about rounding a value to the nearest 0.05 For example, 0.36 should be rounded to 0.35 ... 0.375 should be rounded to 0.4.

Thanks,

Tom


Answer this question

Round to nearest 0.05

  • gorovvv

    Nevermind, Math.Round(d / 0.5, 1) * 0.5; does the trick

  • Round to nearest 0.05