Sprintf() with float values

It's not the number to of digits to "expect" or how many are "sent". It's the number to print. As already noted, a 32-bit floating point number is good for 5-7 significant digits. You can print out beyond that, but those extra digits will be garbage.

You should read this: https://www.cplusplus.com/reference/cstdio/printf/