Announcement

Collapse
No announcement yet.

Adding a decimal to string

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

    Adding a decimal to string

    I am sure I am making this harder than it needs to be. how do I add a decimal to a number. What I mean is this. I have a script that gets data from a json and assigns that info to a hs device. The numbers dont have the decimal in it. So for example, the json shows 12454. It should be 124.54. Or another is 40 should be .40
    Kirk

    http://cleverhouseautomation.ca
    http://southcoastwebsitedesign.ca

    #2
    If you have a number that is consistently scaled by 100 then your script just needs to divide the value by 100 or more efficiently multiply by 0.01.

    Comment


      #3
      Yup that works. Like I said I was way over thinking it. I was counting length and the using the insert to add a period.. lol
      Kirk

      http://cleverhouseautomation.ca
      http://southcoastwebsitedesign.ca

      Comment

      Working...
      X