View previous topic :: View next topic |
Author |
Message |
Offer
Joined: 13 Dec 2010 Posts: 21
|
Posted: Mon Dec 13, 2010 10:51 am Post subject: Can't do calculation on PerfMon replys |
|
|
Hello.
I'm using a performance monitor to retrive numbers that are between 0 and 1. For convience purposes - I want to multiply the answers by 10, so I'll get numbers between up to ten.
The problem is that when I try to enter the expression %suggestedreply% * 10 - I get error "unknown operand "0.74"".
I understand the reason is that HM treats the answer as string instead of real number. Using the %suggestedreply_integer% will not help me, because it truncates the fraction after the decimal point.
Many thanks at advance for a possible solution. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12807 Location: USA
|
Posted: Mon Dec 13, 2010 11:53 am Post subject: |
|
|
Use ['%SuggestedReply%' * 10] expression
Regards
Alex |
|
Back to top |
|
|
Offer
Joined: 13 Dec 2010 Posts: 21
|
Posted: Mon Dec 13, 2010 1:28 pm Post subject: |
|
|
Thanks, Alex.
Simply a genious. (I assume the ''' is converter from string to numeric value?)
Just a little problem stayed:
When I use that formula, I get only Integer numbers as result. (For example - 0.74 becomes 7 after the formula). How can I get 7.4?
Thanks! |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12807 Location: USA
|
Posted: Mon Dec 13, 2010 1:57 pm Post subject: |
|
|
Sorry, don't see such option
HostMonitor rounds results of "Tune up Reply" expression because most of test methods provide integer results only...
Regards
Alex |
|
Back to top |
|
|
Offer
Joined: 13 Dec 2010 Posts: 21
|
Posted: Mon Dec 13, 2010 2:36 pm Post subject: |
|
|
Dear Alex.
Thanks for your answer.
I've tried to be a little genious myself, and here what I came with:
[('%SuggestedReply%' * 1000) div 100].[('%SuggestedReply%' * 1000) mod 100]
What do you think about this? It seems to give the wanted results. Isn't it?
Thanks again. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12807 Location: USA
|
Posted: Mon Dec 13, 2010 4:01 pm Post subject: |
|
|
Goog idea!
I was thinking about similar expressions but was worried by rounding.
This expression should work fine when 1-2 digits after dot is enough.
Regards
Alex |
|
Back to top |
|
|
|