Hi
I need function which returns:
for any number from range => result
[0.001,0.01) => 0.01
[0.01,0.1) => 0.1
[0.1,1) => 1
[1,10) => 10
[10,100) => 100
etc.
My first idea was to use if
, but this the worst way. Is there a simple solution?
Hi
I need function which returns:
for any number from range => result
[0.001,0.01) => 0.01
[0.01,0.1) => 0.1
[0.1,1) => 1
[1,10) => 10
[10,100) => 100
etc.
My first idea was to use if
, but this the worst way. Is there a simple solution?