Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • @Barmer Thanks for your help! How would I adjust the code if there was a 0 at the end of the decimal, for example if the number is 12.3450, the code ignores the 0 and outputs 12.346. How I can get it to output 12.3451? Commented Jun 13, 2017 at 14:54
  • You have to write the number as a string: "12.3450". Otherwise the PHP parser ignores trailing zeroes, there's no way to tell that it was originally written that way. Commented Jun 13, 2017 at 15:38