Ok, I found another corner case (multiple trailing zeros in the grouping string) which seems a bit weird. I was hoping to get rid of the special case in `grouping_to_string` but unfortunately it's still needed (although less hacky, doesn't end in semi-colon anymore).
This is probably the best I can do now while still keeping it correct… Sorry for the noise.