Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Value formatting

Value formatting

Scheduled Pinned Locked Moved Support
5 Posts 3 Posters 32.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N
    N
    Nikk
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi!

      You can format event parameter using script, like this:

      1. use %[formatted_p4] instead of %4

      2. Create script named formatted_p4 in library like this:

      return format($event->parameters[4], 1, 2);

      Best regards,
      Victor

      1 Reply Last reply
      0
      • N
        N
        Nikk
        wrote on last edited by
        #3

        Thank you, Victor! Works great 🙂

        1 Reply Last reply
        0
        • S
          S
          Shebarn
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • S
            S
            Shebarn
            wrote on last edited by
            #5

            Ok, figured it out.

            Used the script in the message of the event's event configuration and it worked perfect...

            1 Reply Last reply
            0

            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
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            Powered by NodeBB Contributors
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups