Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

tcl event manager floating point with tcl_precision

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
Cisco Employee

Re: tcl event manager floating point with tcl_precision

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

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

1 REPLY
Cisco Employee

Re: tcl event manager floating point with tcl_precision

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

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

367
Views
0
Helpful
1
Replies