4 of 4 minor formatting changes

GNU sed, 17 14 + 1(r flag) = 15 bytes

Edit: 2 bytes less thanks to Riley

s:.*([^0]):\1:


It works by deleting everything until the right-most nonzero digit, which is then printed along with any existing trailing zeros. The script can handle multiple tests in one run, each on a separate line.

Try it online! (all test examples)

 answered Feb 21 '17 at 22:07 seshoumara 2,88811 gold badge55 silver badges2424 bronze badges