cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
754
Views
0
Helpful
1
Replies

tcl event manager floating point with tcl_precision

engineer1a
Level 1
Level 1

Hello,

How can the floating point be modified in a event manager tcl script ?

Currently I am trying to write a tcl script to check for disk utilization. I am dividing the free space upon the total space to get a percentage.

and I am always getting "0", so no floating point.

I have tried to modifiy the "floating point" with set tcl_precision but I get the following error :

--> can't set "tcl_precision": can't modify precision from a safe interpreter

Is there a way to modify the floating point ?

I appreciate very much the help on this issue,

Thank you in advance,

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

IOS doesn't do floating point.  You can trick it, though, with something like:

set used [expr ${free}.0 / ${total}.0]

View solution in original post

1 Reply 1

Joe Clarke
Cisco Employee
Cisco Employee

IOS doesn't do floating point.  You can trick it, though, with something like:

set used [expr ${free}.0 / ${total}.0]

Review Cisco Networking for a $25 gift card