Search found 1 match

by PaulyWalnuts
Wed Dec 11, 2013 5:15 am
Forum: Command Line and Scripting Interface
Topic: How to append 0 to prompted number with EVAL
Replies: 1
Views: 1812

How to append 0 to prompted number with EVAL

Really simple one but I'm not familiar with JavaScript. I want to prompt the user for a number, if that number is under 2 digits I want to append a '0' before the first digit, 5->05, 8->08, etc. What I have so far PROMPT Enter<SP>number: !VAR1 SET !VAR1 EVAL("var x = newX(); if (x.length < 2) {'0' +...