NetXMS Support Forum

English Support => General Support => Topic started by: Egert143 on May 26, 2022, 11:45:26 AM

Title: format dci coordinate
Post by: Egert143 on May 26, 2022, 11:45:26 AM
Hello

When i have coordinate dci for example "5837845.0", how can i convert it to "58.37845"?

I tried Transformation with "return $1/100000;" but this results "58.378520", there is extra 0 in the end. How to remove it ?

Egert
Title: Re: format dci coordinate
Post by: Filipp Sudanov on May 26, 2022, 04:09:09 PM
return format($1/100000, 1, 5);

should do the job. https://www.netxms.org/documentation/nxsl-latest/#func-format
Title: Re: format dci coordinate
Post by: Egert143 on May 26, 2022, 04:31:25 PM
When i tested format, under history it shows correctly, no trailing "0". But under Last Values, it still shows extra "0".

Also when i test without format, it still show correctly in history, but with extra 0 in Last Values.
Title: Re: format dci coordinate
Post by: Filipp Sudanov on May 26, 2022, 11:45:55 PM
This depends on whether your DCI is string or float. Looks like it's float - in this case displaying works with 6 digits after comma. If you select string it will probably show as you like.
Title: Re: format dci coordinate
Post by: Egert143 on May 27, 2022, 07:55:38 AM
With string formating it shows correctly, but then its not possible to create thresholds with less than or greater than.
Title: Re: format dci coordinate
Post by: Filipp Sudanov on June 01, 2022, 02:20:29 PM
Actually this is a bug - in last values it should be displayed the same way as in history. This will be fixed.

In the future custom formatting will be implemented - you can follow this issue: https://track.radensolutions.com/issue/NX-2265
Title: Re: format dci coordinate
Post by: Egert143 on June 02, 2022, 08:36:57 AM
Many thanks :)

Egert