Forum Discussion
Nuno_Paulino_10
Nimbostratus
Aug 09, 2006Floating values in iRules
Hello!
I am trying to use floating values in iRules and I am having some problems. When i run the following code:
when HTTP_RESPONSE {
set clicks_server_response [expr [clock clicks -milliseconds] / 1000.0]
log local1.info $clicks_server_response
}
I am getting in the logs the string "%g", instead of the corresponding floating value:
... : %g ...
I tryed to use the "format function" and i found the same problems. Does the iRules "TCL subset" suports floating values ?
I even tryed a simple example from manuals and the result is also the "%g" string
% set result [expr (4.0+6)/4]
=> %g
Any ideas?
Best regards,
Nuno Paulino
3 Replies
- Deb_Allen_18Historic F5 AccountI dug into this a bit and found also that using [format %f ...] to force to floating point returns "%f" instead of a numeric value.
I opened a case, will let you know what I find out.
/deb - Deb_Allen_18Historic F5 AccountFrom Support:
"CR68915 has created to track this issue.
The problem is that we use a scaled down (optimized) version of printf in tmm. We currently do not support "%f" and "%g" calculations in our printf. Thus the default output (the string %f or %g) is returned instead of desired calculation."
If this issue is important to you, you can increase its visibility in Development by openning a new case with F5 Support referencing this CR.
/deb - JRahm
Admin
Optimized.... so that's what we're calling bugs these days! We used to call them *features* (he he)
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects