This heuristic could go slightly wrong, for example causing "10.000" to render as "#i10.0" instead of "10.0", but it won't affect cases where the output already matched the input.