Quote from
Gaev on December 27, 2019, 5:43 am
@rrey
Looks like VisualNEOWeb is missing the NumToString command ... but you can use the Javascript function called .toString() like so ...
SetVar [gkNum] 13456
BeginJS
$App.gkString = $App.gkNum.toString();
EndJS
... trim first digit
StrLen "[gkString]" [gkStringLen]
Math "[gkStringLen]-1" 0 [gkStringLenTrimmed]
... copy from second character (which is index 1)
StrCopy "[gkString]" 1 [gkStringLenTrimmed] [gkTrimmed]
AlertBox "gkTrimmed" "[gkTrimmed]" ""
... note that by using the value of StrLen - 1 in the StrCopy command, this code will work with numbers of all sizes (not just those with 2 integers).
@rrey
Looks like VisualNEOWeb is missing the NumToString command ... but you can use the Javascript function called .toString() like so ...
SetVar [gkNum] 13456
BeginJS
$App.gkString = $App.gkNum.toString();
EndJS
... trim first digit
StrLen "[gkString]" [gkStringLen]
Math "[gkStringLen]-1" 0 [gkStringLenTrimmed]
... copy from second character (which is index 1)
StrCopy "[gkString]" 1 [gkStringLenTrimmed] [gkTrimmed]
AlertBox "gkTrimmed" "[gkTrimmed]" ""
... note that by using the value of StrLen - 1 in the StrCopy command, this code will work with numbers of all sizes (not just those with 2 integers).