We should just strip off 0's after the decimal point? Something like;

s/.?0+$//