I have a small script that read delta X and Y of a joystick and next cast they into character:
var a =deltaX.toString();
var b =deltaY.toString();
outputEl.innerHTML = '<b>Result:</b> '
+ a
+ b;
var comando = a + b ;
the trouble is I need number lower than 10 and -10 , to be 2 characters , so for example 5 , to be 05 . what's should be a good way to add the zero in the numbers lower than 10 and -10 ?