De-duplicate number formatting implementations for smaller code size
De-duplicate number formatting implementations for smaller code size

Instead of inlining the same logic into every number formatting implementation,
pull it out into a function that each of the number formatting impls call into.

graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust