Jump to content

zeros after decimal point - Money


Giddy Rob

Recommended Posts

Hi,

 

I have created a shopping cart, which adds and subtracts the value of an item the more or less the customer has in their cart. The problem is is that I would like it to show two digits after the decimal point, but it just chops of the .*0 or .00. If the result is 19.95 that is fine but if its 19.00 it outputs just 19. If the result is 19.90 it just outputs 19.9.

 

What do I need to do to create the extra 0/0's if necessary?

 

Cheers

 

Rob

 

 

Link to comment
Share on other sites

Hi,

 

thanks for the response but for some reason the money function messed up the shopping cart, which seems very strange when all it appears to do is reformat the array value for outputting to the screen.

 

I have used the number_format() function and this seems to work perfectly.

 

Any clues why this might cause a problem?

 

Cheers

 

Rob

Link to comment
Share on other sites

Any clues why this might cause a problem?

 

Not unless you would kindly post the code that did not work using money format function and the code using the number_format() function so that someone could see what you changed that was not correct.

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.