+ let percentStr = args.shift() || "100.0";
+ // pass: .1 0.1, 1, 1.0, 10, 10.0, 100, 100.0
+ // fail: 1000, 10.00
+ if (!/^1?\d?\d?(\.\d)?$/.test(percentStr)) {
+ console.error("Error: withdrawal percent must be between 0.1 and 100.0");
+ process.exit(1);
+ }
+ let percent = parseFloat(percentStr);