Suunto app Forum Suunto Community Forum
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    [help]About Ambit app,Why is this result an integer

    Scheduled Pinned Locked Moved Digital service transition
    ambit apps
    6 Posts 2 Posters 443 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z Offline
      zt_zzzzz
      last edited by

      [help]About Ambit app,Why is this result an integer

      /* While in sport mode do this once per second */
      RESULT = 0;
      FTP=SUUNTO_USER_HEIGHT+100;
      if (SUUNTO_BIKE_POWER_AVG[3] < FTP * 55/100) {
        RESULT=(1.0+  ( SUUNTO_BIKE_POWER_AVG[3] /  (FTP * 55/100)  ) ) ;postfix="ActRec";
      }
      else if (SUUNTO_BIKE_POWER_AVG[3]>FTP * 55/100 && SUUNTO_BIKE_POWER_AVG[3]< FTP * 75/100)
       {RESULT=(2.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 55/100) ) / ( (FTP * 75/100) - (FTP * 55/100) ) ) );postfix="Endur"; }
      else if (SUUNTO_BIKE_POWER_AVG[3]>FTP * 75/100 && SUUNTO_BIKE_POWER_AVG[3] < FTP * 90/100)
      
      {RESULT=(3.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 75/100) ) / ( (FTP * 90/100) - (FTP * 75/100) ) ) ) ;postfix="Tempo"; }
      
      
      else if (SUUNTO_BIKE_POWER_AVG[3]> FTP * 90/100 && SUUNTO_BIKE_POWER_AVG[3]< FTP* 105/100 )
            {RESULT=(4.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 90/100) ) / ( (FTP * 105/100) - (FTP * 90/100) ) ) );postfix="Thresh"; }
               
      else if(SUUNTO_BIKE_POWER_AVG[3]> FTP * 105/100 && SUUNTO_BIKE_POWER_AVG[3]< FTP * 120/100)
            {RESULT=(5.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 105/100) ) / ( (FTP * 120/100) - (FTP * 105/100) ) ) ) ;postfix="VO2M"; }
               
      else if(SUUNTO_BIKE_POWER_AVG[3]> FTP * 120/100 && SUUNTO_BIKE_POWER_AVG[3]< FTP * 150/100)
          {RESULT=(6.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 120/100) ) / ( (FTP * 150/100) - (FTP * 120/100) ) ) );postfix="Anaer"; }
               
      else if (SUUNTO_BIKE_POWER_AVG[3] > FTP * 150/100 )
         {RESULT=(7.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 150/100) ) / ( 2000 - (FTP * 150/100) ) ) ) ;postfix="SPRINT"; }
        
      

      The result is 1 2 3 4 5… no 1.x 2.x…

      pavel.samokhaP 1 Reply Last reply Reply Quote 0
      • pavel.samokhaP Offline
        pavel.samokha @zt_zzzzz
        last edited by

        @zt_zzzzz I guess you need to add

        format = OneDecimal
        

        to Header section, as described in https://forum.suunto.com/topic/7592/ambit-apps-compilation

        Opinions expressed are solely my own and do not express the views or opinions of my employer

        Z 2 Replies Last reply Reply Quote 1
        • Z Offline
          zt_zzzzz @pavel.samokha
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • Z Offline
            zt_zzzzz @pavel.samokha
            last edited by zt_zzzzz

            @pavel-samokha said in [help]About Ambit app,Why is this result an integer:

            @zt_zzzzz I guess you need to add

            format = OneDecimal
            

            to Header section, as described in https://forum.suunto.com/topic/7592/ambit-apps-compilation

            Thinks,I tried this:

            format = OneDecimal;
            
            Compile:
            "[ErrorCode, COMPILATION_FAILED]\r\n[ErrorLine, 3]\r\n[ErrorColumn, 20]"
            
            OR
            
            format = “OneDecimal”;
            
            Compile is OK,but result is 1 2 3 4 not 1.x 2.x
            
            TheSunntoAppDevelpoerManual saide :
            
            RESULT can be shown in four different formats, available from the Format drop-down list.
            Depending on the option selected, the value 100 could be displayed as:
            time: 0:01’40
            0 decimal: 100
            1 decimal: 100.0
            2 decimals: 100.00
            

            format = 1;
            but result also is 1 2 3 4 not 1.x 2.x

            pavel.samokhaP 1 Reply Last reply Reply Quote 0
            • pavel.samokhaP Offline
              pavel.samokha @zt_zzzzz
              last edited by

              @zt_zzzzz have you put it in the Header section?

              I’ve just tried with the default sample, and it compiles properly, see:

              Screen Shot 2022-03-15 at 12.26.12.png

              Opinions expressed are solely my own and do not express the views or opinions of my employer

              Z 1 Reply Last reply Reply Quote 1
              • Z Offline
                zt_zzzzz @pavel.samokha
                last edited by

                @pavel-samokha

                O,I made a mistake,Let format=OneDecimal;,This is no in HEADER
                Modify to:

                /***HEADER***/
                format = OneDecimal
                /***ENDHEADER***/
                /* While in sport mode do this once per second*/
                RESULT = 0;
                FTP=SUUNTO_USER_HEIGHT+100;
                format = 1;
                if (SUUNTO_BIKE_POWER_AVG[3] < FTP * 55/100) {
                  RESULT=(1.0+  ( SUUNTO_BIKE_POWER_AVG[3] /  (FTP * 55/100)  ) ) ;postfix="ActRec";
                }
                else if (SUUNTO_BIKE_POWER_AVG[3]>FTP * 55/100 && SUUNTO_BIKE_POWER_AVG[3]< FTP * 75/100)
                 {RESULT=(2.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 55/100) ) / ( (FTP * 75/100) - (FTP * 55/100) ) ) );postfix="Endur"; }
                else if (SUUNTO_BIKE_POWER_AVG[3]>FTP * 75/100 && SUUNTO_BIKE_POWER_AVG[3] < FTP * 90/100)
                
                {RESULT=(3.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 75/100) ) / ( (FTP * 90/100) - (FTP * 75/100) ) ) ) ;postfix="Tempo"; }
                
                
                else if (SUUNTO_BIKE_POWER_AVG[3]> FTP * 90/100 && SUUNTO_BIKE_POWER_AVG[3]< FTP* 105/100 )
                      {RESULT=(4.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 90/100) ) / ( (FTP * 105/100) - (FTP * 90/100) ) ) );postfix="Thresh"; }
                         
                else if(SUUNTO_BIKE_POWER_AVG[3]> FTP * 105/100 && SUUNTO_BIKE_POWER_AVG[3]< FTP * 120/100)
                      {RESULT=(5.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 105/100) ) / ( (FTP * 120/100) - (FTP * 105/100) ) ) ) ;postfix="VO2M"; }
                         
                else if(SUUNTO_BIKE_POWER_AVG[3]> FTP * 120/100 && SUUNTO_BIKE_POWER_AVG[3]< FTP * 150/100)
                    {RESULT=(6.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 120/100) ) / ( (FTP * 150/100) - (FTP * 120/100) ) ) );postfix="Anaer"; }
                         
                else if (SUUNTO_BIKE_POWER_AVG[3] > FTP * 150/100 )
                   {RESULT=(7.0 + ( ( SUUNTO_BIKE_POWER_AVG[3] - (FTP * 150/100) ) / ( 2000 - (FTP * 150/100) ) ) ) ;postfix="SPRINT"; }
                

                The result is Ok!

                Thanks very much!

                1 Reply Last reply Reply Quote 3
                • First post
                  Last post

                Suunto Terms | Privacy Policy