Value formatting
-
Hi,
How can i get clean formatted value in last value window (or better as event parameter)? What I want to do is format or round disk space value.
The value shows up like 12.410000 , but it should be like 12.41 (as it shows in history table) because transformation script is: format($1,1,2) or round($1,2).And event parameter %4 is also taking those zeros. How can I get rid of those zeros?
Nikk
-
Hi!
You can format event parameter using script, like this:
-
use %[formatted_p4] instead of %4
-
Create script named formatted_p4 in library like this:
return format($event->parameters[4], 1, 2);
Best regards,
Victor -
-
-
I have the same problem with voltage return as float.
My Transformation looks like this normally:
return $1/10;
(since the value returned is always 10x the actual voltage value)
But this always gives me a value of i.e. 23.500000
return format($1/10, 1, 1) gives the right value when I test it at transformation but not when the alarm is raised.
I tried Victor's solution of script:
Script Name: retvolt
Script Content: return format($event->parameters[1]/10, 1, 1);At transformation I then put: return $[retvolt];
I get error: Error 34 in line 1: Function or operation argument is not a container
I assume I am calling the script the wrong way, but can't find examples of how to do it otherwise?
Please help. -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login