Jump to content

[SOLVED] Format a number, but INCLUDE trailing 0's?


DaveLinger

Recommended Posts

So I have an assortment of numbers coming in, they're all zero point something. I want them to round to zero point number number - like currency... $0.XX. Problem I'm running into is that when I do round($var, 2), it cuts off trailing zeros, so some numbers end up as $0.X, because the next number would have been a zero. How do I keep that on there?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.