I’ve searched high and low, but in printf in C it seems that there’s only zero fill and white space fill. I’m looking to write my own fill, in this case using the asterisk.
For example,
Assuming a width of 8 character.
Input: 123
Ouput: **123.00
Input: 3
Output: ****3.00
How can I do that?
The simplest way is probably to print into a buffer using
snprintf()with space padding, then replace the spaces with asterisks afterwards: