Maybe you are using wrong "TYPE" action, or you are
typing to wrong "TEXT AREA" field. Bare in mind that there are
2 "TYPE TEXT" actions. From the error tnfo, you are trying to
type text in [documentRoot], which is highest level of page,
or generaly speaking web page as a whole. Usually you want
to type text in some text area or text field. In contast, you might
be using another type action that is usually used to emulate
kryboard/
Convert the value 1.5K
-
@to-nice you can use JS expressions, as "parseInt", "parseFloat"
parseInt("1.6k")
1
parseFloat("1.6k")
1.6
check, if string has k|K then multiply it by 1000 and so on...var str = "1.6k";
var result = parseFloat(str);
if(str.indexOf("k") != -1){
result = result * 1000;
} -
@BAS-Viet-Nam @clarabellerising WHERE IS ERROR ?
var str = "[[VAR]]"; // Sostituisci con il valore che vuoi convertire
var result = parseFloat(str);if (str.indexOf("k") != -1) {
result = result * 1000;
} else if (str.indexOf("M") != -1) {
result = result * 1000000;
}// Salva il risultato in una variabile globale di BAS
SetGlobalVariable("CONVERTED_VALUE", result.toString()); -
@to-nice in "[[VAR]]"
[[VAR]] is already a variable, you should use just [[VAR]], not "[[VAR]]"
also, im not sure that "else if" exists in js, so, you can just do another if condition
if .indexOf("k"){}
if .indexOf("M"){}
no need to use else -
@clarabellerising in this mode ?
var str = [[VAR]]; // Sostituisci con il valore che vuoi convertire
var result = parseFloat(str);if (str.indexOf("k") != -1) {
result = result * 1000;
}
if (str.indexOf("M") != -1) {
result = result * 1000000;
}
and... how to save result in variable ? thankyouu -
@clarabellerising working perfect !! thankyou