01-15-2014 12:56 PM
Hi,
As part of an EEM script I am collecting the bytes downloaded on my WAN interface, formatting it and using it to create a banner with the monthly usage. The numbers get quite large and I am getting the following message:
%HA_EM-6-FMPD_OPERAND_INVALID: Invalid operand in action, expected value within range -2147483648 to 2147483647, received: 4824555627
Is there anyway around this?
Ryan
01-16-2014 04:23 AM
Hi Ryan,
I don't know it it's recommendable, but if you really want to do calculations with such large numbers, you could use floating-point values instead of integers:
R1(tcl)#set x 4824555627
4824555627
R1(tcl)#puts [expr $x]
integer value too large to represent
R1(tcl)#puts [expr [format "%.1f" $x]]
4824555627.0
R1(tcl)#puts [expr [format "%.1f" $x] * 10]
48245556270.0
Perhaps you should wait a while for other answers or a confirmation as I'm not very experienced with TCL.
Regards
Rolf
01-16-2014 06:53 AM
Yep, this is the way to go. You need to use Tcl, and you need to convert to floating point. One easy way to do the conversion is with:
set num "${num}.0"
Then you can operate on $num like an FP. This doesn't work with applets, so Tcl is the only way to go.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide