There might be a better way, but the following approach seems preferable:
using Formatting
fm1 = generate_formatter("%5.3'f")
fm2 = generate_formatter("%'d")
x, y = π*1e9, 3141592654
printfmt("float: {1} and integer: {2} (Formatting.sprintf1)", fm1(x), fm2(y))
# Result:
float: 3,141,592,653.590 and integer: 3,141,592,654 (Formatting.sprintf1)