Force php to display number as 0.000001 instead of f 1.0E-6
I want to force php to output the number 开发者_StackOverflow中文版as a decimal number, not 1E-6. Is this possible?
Use printf
: printf("%0.6f", $var);
Alternatively, sprintf
returns a string rather than printing directly to the output.
精彩评论