Announcement

Collapse
No announcement yet.

Precision of toString

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Precision of toString

    I have an issue with the number of decimal places generated by ToString as documented here: http://board.homeseer.com/showpost.p...&postcount=245

    To summarize, the call to hs.DeviceValueByNameEx(lon).ToString() only returns 3 decimal places even though the value has many more. How can I control the output of ToString?

    #2
    What does hs.DeviceValueByNameEx(lon) return? The ToString() is a vb.net function that shouldn't be adjusting the length at all.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      The ToString() function can be overridden.

      However, you can try this:
      Code:
      Dim d as Double = hs.DeviceValueByNameEx(lon)
      hs.Writeline("Output test", "'" & d & "'"
      If that still gives you three decimals then DeviceValueByNameEx does not return more.
      HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
      Running on Windows 10 (64) virtualized
      on ESXi (Fujitsu Primergy TX150 S8).
      WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

      Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

      Comment

      Working...
      X