1

I'm thinking how to implement some kind of rounding. For example:

0.18 -> 0.2
1.8  -> 2
18   -> 20

and so on.

I consider to use Math.Round for number from 0 - 1:

Input: 26
26 * 10^-2 = 0.26
Math.Round(0.26, 2) == 0.3
0.3 * 10^2 = 30

So, 10^(-)2 is x. How to calculate it? Or maybe better algorithm?

Ievgen Martynov
  • 7,870
  • 8
  • 36
  • 52

0 Answers0