I am trying to display a distance value ofr elements but I can’t find the correct operators to do it.
Example:
I have a value of 23 returned via SNMP that represents 2.3 miles.
The value seems to be stored as an integer so if I divide by 10, I lose the remainder.
I tried bitwise operators but they don’t seem to be reported.
I tried the following [(23/10)*10] and this returns 23. Therefore, it doesn’t appear it is being stored as an integer as the above forula should return 20. I was going to divide and multiply by 10 and then subtract that value from the original to get the 10ths value. However, this won’t work due to the formula results.
Yes, calculations internally are performed with floating point variables, but
when outputting they are rounded to integer. We will see what we can do about it.
rate() is internal function. You cannot make such a function with current
scripting capablities.
You should not care about number base as long as you get the value from SNMP
with oid type ‘integer, counter, unsigned integer’ because the value is
retrieved in binary form.