Why is PHP printing my number in scientific notation, when I specified it as .000021?

Use number_format() to get what you’re after:

print number_format($var, 5);

Also check sprintf()

Leave a Comment