Round to the nearest tenth position I'm new to this forum, but I wanted to post this question hoping to know if anyone has come across it.
Is there a formula in math to round down to the closest power of ten?
For example, 
$n$ : the number, $r$: the round value.
if $n = 101\Rightarrow r = 100$.
if $n = 322\Rightarrow r = 100$. 
if $n = 1200\Rightarrow r = 1000$. 
if $n = 77\Rightarrow r = 10$. 
We need this in finance business, where trades are bought in lot sizes of $10, 100, 1000$ etc.

If you always round to the largest previous power of 10, use
$$r=10^{\lfloor\log_{10}(n)\rfloor},$$
where $\lfloor x\rfloor$ is the floor function.
