in reply to Eliminating Trailing Zeros

For completeness' sake, one that doesn't break when there's no decimal point.
s/(?:(\.\d*[1-9])|\.)0+\z/$1/;

Makeshifts last the longest.