KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Can't do calculation on PerfMon replys

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Bug reports
View previous topic :: View next topic  
Author Message
Offer



Joined: 13 Dec 2010
Posts: 21

PostPosted: Mon Dec 13, 2010 10:51 am    Post subject: Can't do calculation on PerfMon replys Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12339
Location: USA

PostPosted: Mon Dec 13, 2010 11:53 am    Post subject: Reply with quote

Use ['%SuggestedReply%' * 10] expression

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
Offer



Joined: 13 Dec 2010
Posts: 21

PostPosted: Mon Dec 13, 2010 1:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12339
Location: USA

PostPosted: Mon Dec 13, 2010 1:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Offer



Joined: 13 Dec 2010
Posts: 21

PostPosted: Mon Dec 13, 2010 2:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12339
Location: USA

PostPosted: Mon Dec 13, 2010 4:01 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Bug reports All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index