GPS speed to knots[SOLVED]

Hi to all,

i am trying to read into the mikrotik the speed of the gps from km/h to knots…

:local speedknots [$speed * 0.5399]

any suggestion?

Thanks

It seems that RouterOS does not support decimals

But to do math, you need parentheses.

{
local speed 10
:put $speed
:local speedknots ($speed * 5)
:put $speedknots
}

How about this?

{
  :local speed 10;
  :local speedknots (($speed * 5399 / 10000) . "." . (($speed * 5399 / 10) - ($speed * 5399 / 10000 * 1000)));
  :put $speedknots;
}

This is ugly, but it works. :laughing:
Note that $speedknots is a string, not a number. Your can print it, but you can not use it for more math.

Will be solved in ROS 7…

thanks man! works perfect :slight_smile: