Announcement

Collapse
No announcement yet.

decimals showing up wrong after (clean install of OS windows)

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

    decimals showing up wrong after (clean install of OS windows)

    SOLVED:
    Decimal symbol : .
    Grouping symbol : ,





















    Hi all

    well before my decimals show normal after my script started.
    right now they return total wrong

    this is how it should be :
    jan-22 11:43:41 current consume 0.03 kWh
    jan-22 11:43:41 current actual produce -0 kWh
    jan-22 11:43:41 low produced 635.82 kWh
    jan-22 11:43:41 high produced 1524.19 kWh
    jan-22 11:43:41 low consumed 1487.34 kWh
    jan-22 11:43:41 high consumed 900.03 kWh
    jan-22 11:43:41 Total 227.36
    jan-22 11:43:41 payment / returns -4.82€
    jan-22 11:43:41 gasTOTAL 974.81m³
    jan-22 11:43:41 Malosa P1 Updating
    right now
    jan-29 14:49:52 low produced 6389830 kWh
    jan-29 14:49:52 high produced 15256460 kWh
    jan-29 14:49:52 low consumed 15366780 kWh
    jan-29 14:49:52 high consumed 9369670 kWh
    jan-29 14:49:52 Total 3090160
    jan-29 14:49:52 payment / returns -1729272550€
    jan-29 14:49:52 gasTOTAL 10544,73m³
    This is what i have in the ini, it always work normal

    highcons = (FormatNumber(highcons /1000,2 ))
    lowcons = (FormatNumber(lowcons /1000,2 ))
    GasToTal = (FormatNumber(GasToTal /1,2 ))

    and so on...

    Am i missing something in dotnet ?
    this info is from an xml page. it worked yesterday...


    Regards
    Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
    Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




    HS3Pro 4.1.14.0 on windows 10 enterprise X64 on hp quadcore laptop 8 GB.

    #2
    I did another test and something is really wrong but i don't where the problem is

    When i use this code :

    dim tada as double = "638983.000"
    tada = (FormatNumber(tada /1000,2 ))
    hs.writelog ("tada",tada)
    jan-29 16:32:37 tada 638983
    This doesnt make any sense.. so if i do this:
    tada = (FormatNumber(tada /1000000,2 ))
    it shows correct...
    jan-29 16:30:21 tada 638,98


    this happens when i did reinstall windows... now all my scripts are messed up and can't use them anymore...
    Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
    Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




    HS3Pro 4.1.14.0 on windows 10 enterprise X64 on hp quadcore laptop 8 GB.

    Comment


      #3
      Could this be related to the locale?
      HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

      Comment


        #4
        Originally posted by langenet View Post
        Could this be related to the locale?
        i did check my localisation setting in windows and its normal..

        Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
        Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




        HS3Pro 4.1.14.0 on windows 10 enterprise X64 on hp quadcore laptop 8 GB.

        Comment


          #5
          It looks like you have a mix of localization i.e. your Ini data is using a decimal point but your local region uses a comma.

          As the data is stored in an ini file, you can probably read the data and just use a replace statement to convert a dot to a comma before doing the math.
          Jon

          Comment


            #6
            Originally posted by jon00 View Post
            It looks like you have a mix of localization i.e. your Ini data is using a decimal point but your local region uses a comma.

            As the data is stored in an ini file, you can probably read the data and just use a replace statement to convert a dot to a comma before doing the math.
            thanks for the reply
            is there a way to change it easy without modify the scripts?
            i have many other scripts like this?
            It did work yesterday.

            Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
            Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




            HS3Pro 4.1.14.0 on windows 10 enterprise X64 on hp quadcore laptop 8 GB.

            Comment


              #7
              You could change your locale to US or UK
              Jon

              Comment


                #8
                Originally posted by jon00 View Post
                You could change your locale to US or UK
                i have it already on US.
                it was an other locale before
                but still no luck


                even if i try this in a script..

                dim tada as double = "638983.000"
                tada = (FormatNumber(tada /1000,2 ))
                hs.writelog ("tada",tada)

                638983

                This doesnt make any sense.. so if i do this:
                tada = (FormatNumber(tada /1000000,2 ))
                hs.writelog ("tada",tada)

                638,98

                it doesn' t calculate right, normal the above first code should give 638,98 but it doesnt..


                i did also try on my other pc there it now has also the issue..
                is this an homeseer issue ?

                i was before on 531
                it does it both on 548 and hs4 v05
                Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
                Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




                HS3Pro 4.1.14.0 on windows 10 enterprise X64 on hp quadcore laptop 8 GB.

                Comment


                  #9
                  whatever i change in my regional settings like a comma or decimals doesnt affect anything.. homeseer keeps using the old settings.. even after restart
                  Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
                  Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




                  HS3Pro 4.1.14.0 on windows 10 enterprise X64 on hp quadcore laptop 8 GB.

                  Comment


                    #10
                    It won' t me let edit my first post,

                    I did solve it, apperantly the region settings did not work after been saved...
                    i did try multiple times and i fixed it.

                    SOLVED:
                    Decimal symbol : .
                    Grouping symbol : ,
                    Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
                    Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




                    HS3Pro 4.1.14.0 on windows 10 enterprise X64 on hp quadcore laptop 8 GB.

                    Comment


                      #11
                      Originally posted by Malosa View Post
                      dim tada as double = "638983.000"
                      tada = (FormatNumber(tada /1000,2 ))
                      hs.writelog ("tada",tada) [TABLE="cellspacing: 0"]
                      I am confused as to how you got it working. "tada" is declared as a "double", but hs.writelog is expecting a string for the second parameter. So there is a implicit conversion that the compiler is doing for you, which may produce results you do not want. (There is another implicit cconversion also converting the string "638983.000" into a double.)

                      I would try something like the following:

                      dim tada as double = 638983.000
                      dim strtada As String = (FormatNumber(tada /1000,2 ))
                      hs.writelog ("tada",strtada)

                      Of course you paraphrased your code, so perhaps your actual code is different...

                      Comment


                        #12
                        Originally posted by aa6vh View Post

                        I am confused as to how you got it working. "tada" is declared as a "double", but hs.writelog is expecting a string for the second parameter. So there is a implicit conversion that the compiler is doing for you, which may produce results you do not want. (There is another implicit cconversion also converting the string "638983.000" into a double.)

                        I would try something like the following:

                        dim tada as double = 638983.000
                        dim strtada As String = (FormatNumber(tada /1000,2 ))
                        hs.writelog ("tada",strtada)

                        Of course you paraphrased your code, so perhaps your actual code is different...
                        this is actually how my code looks like...


                        try to run this and let me know whats the output



                        Sub Main(ByVal Parms As Object)
                        dim tada as double = "638983.000"
                        tada = (FormatNumber(tada /1000,2 ))
                        hs.writelog ("tada",tada)
                        end sub

                        Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
                        Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




                        HS3Pro 4.1.14.0 on windows 10 enterprise X64 on hp quadcore laptop 8 GB.

                        Comment

                        Working...
                        X