3 ms·$ echo -e '0001\n0010\n0002\n0' | bc 1 10 2 0by jraph 8y ago$ echo -e '0001\n0010\n0002\n0' | bc 1 10 2 0hellabites 8y agoThis is better relative to the `sed` solution as it handles the `0000` case well.