[help]About Ambit app,Why is this result an integer
-
[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…
-
@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
-
This post is deleted! -
@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 -
@zt_zzzzz have you put it in the Header section?
I’ve just tried with the default sample, and it compiles properly, see:
-
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!