2 of 4 better explanation

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

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

It works by deleting everyhting until the right-most nonzero digit that is followed by trailing zeros or nothing at all. The script can also handle multiple inputs, one per line.

Try it online! (all test examples)