Precision is documented as how many digits after the decimal point should be printed. This clearly would not include the added underscores, which may thus increase the length of this part. That is a feeble reason to put the underscore afterwards, but maybe nobody can remember this order, so it might come equivalently before or after precision.
What about the Indian numbering system where (provided I understand correctly) digits are separated into one group of 3, then successive groups of 2? Would be a bit of a shame to introduce a feature like this that excludes roughly 1.85 billion people.
There might be other digit grouping systems, I'm not an expert and Wikipedia didn't obviously call any others out. I only know about the crore and lakh because of an old Tom Scott video.
As @jdahlstrom points out, that's sadly not a topic for Rust. If it ever were, this could be extended as {:_2_3}.
Btw. east Asians count in powers of myriads (万, man = 1_0000; 億, oku = 1_0000_0000) yet in arabic numbers still put the separator at powers of thousands (10_000; 100_000_000) western style. It rightly confuses the shit out of them. I've seen several get completely lost about simple millions.
Then again Murricans don't know what a billion really is, being lost on the weirdly mixed short scale (which should be written 1_000_000000.) Though Wall St. has yards of Dollars, meaning milliards. So it's not completely lost, though almost.
I think what you're discussing is functionality that the num_format crate provides; I don't see a reason for this to be in the language or standard library.
I think there'd be value in supporting a simple version of this, for more readable debug-oriented printing of numbers expected to be large. Full generality of something like this (including the use of a different separator, and localization-specific formatting) doesn't belong in the standard library, but a simple "insert _ every N characters starting on the right" seems worthwhile.
Generalising the Indian idea, we could handle the annoyingly chaotic UUID format natively. Depending on which one is specified to repeat {uuid:x_8_4_12} or {uuid:x_8_4_4_4_12} would be all it takes (plus .replace('_', "-").)
I also like binary formatting for floats with grouping for sign/mantissa/exponent bits. Ditto for hex floats. Though those are fairly niche uses, in the end using a crate is fine in practice.
No problem with grouping by 4 (or 8) for power of 2 bases.
As Debug output, I don't think we need to give the user arbitrary control over spacing though. Typically anyone who is thinking about display format enough to not accept the default spacing will also prefer the underscore to be a space, comma, or period. Any more complicated schemes should use a crate.
Formatting with plain #? works better for containers: