When you need fine-grained control over output format, sprintf() and number_format() are your best tools.
sprintf()returns a formatted string using format specifiers like%s(string),%d(integer),%f(float),%02d(zero-padded integer).printf()is the same but prints directly.number_format()formats a number with grouped thousands and decimal precision.