Announcement

Collapse
No announcement yet.

Reduce decimals

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

    Reduce decimals

    Hello,

    We mesure and calculate the current Watt.
    Is there a simple method to reduce the decimals after the comma ?

    <TABLE cellSpacing=1 cellPadding=0 width="100%" border=0><TBODY><TR><FORM name=chkOPForm1941 method=post><TD class=tablerowodd noWrap align=middle><INPUT class=formcheckbox onclick=buildList(this); type=checkbox value=1941 name=chkOP1941> </TD></FORM><TD class=tablecellcustom id=dv1941> 354,963948973932 </TD><TD class=tablerowodd>Garage</TD><TD class=tablerowodd>Current</TD><TD class=tablerowodd>Watt </TD><TD class=tablerowodd>V5</TD><TD class=tablerowodd noWrap>Interface Variable</TD></TR></TBODY></TABLE>

    Thanks,

    Renaatdb

    #2
    You are storing data in HS Device V5. In the procedure you use to store the data you need to format it in whatever manner you desire. The scripting Round function will accomplish this. e.g. Output = Round(Input,2).

    When mcsTempeature provides the interface to external data then it will limit it based upon the significant digits setting defined by the user.

    Comment


      #3
      If you are using VB.NET to set the device string, you can format the string to just 2 decimals like this:

      Dim watt as Double
      .
      . (compute the watts)
      .
      hs.SetDeviceString("A1",watt.ToString("F2"))

      Steve

      Comment

      Working...
      X