Generic Formatting
If you are not handling numbers or currency values, you can use the printf() family of functions to perform arbitrary formatting of a value. All the functions in this group performin an essentially identical way: they take an input string that specifies the output format and one or more values. The only difference is in the way they return their results: the “plain” printf() function simply writes it to the script’s output, while other variants may return it (sprintf()), write it out to a file (fprintf()), and so on.
If you are not handling numbers or currency values, you can use the printf() family of functions to perform arbitrary formatting of a value. All the functions in this group performin an essentially identical way: they take an input string that specifies the output format and one or more values. The only difference is in the way they return their results: the “plain” printf() function simply writes it to the script’s output, while other variants may return it (sprintf()), write it out to a file (fprintf()), and so on.