see number with 1 number after the .

hello
if I print the byte-out of active user in hotspot
and then divide it by 1048576 , I will see the only the Integer
for example - if I have 10414452 bytes → I will see 9Mb
how can I make it show me 9.9 ?

I keep the value of the byte-out as an global variable

Thanks ,

Unfortunately, RouterOS rounds everything to integers, but I found this script which calculates decimals:
http://wiki.mikrotik.com/wiki/Calculate_with_decimal_numbers

I tested it on 6.7, and it works with adding, subtracting, and multiplying, but dividing seems to be broken! Which is what you’re looking for… Hm.

If you do try the script, there’s one typo in the code that I saw right off. Line 18 (the last commented line in the instructions) should be :put $decimalresult (there is a missing letter l)

Ok, this one works:
http://forum.mikrotik.com/t/decimals/21737/1

For testing, change the top part of the script to:
:local dividend 10414452
:local divisor 1048576
:local decimalplaces 2Enclose the whole script in brackets {} and paste into the terminal. Output:
10414452 / 1048576 = 9.93

Thanks again
I have done my changes - and it’s work wonderful

Thanks !