Jump to content

Changing from minus to plus


petenaylor

Recommended Posts

Hi all

 

I have a string called $voucher_code which is a value used to deduct or add value to a shopping cart. If the value is a minus I need it to show the minus sign, or if it's a plus value, it needs to show a plus sign.

 

Here's my code:

 

<strong>£ -".number_format(($voucher_code),2)."</strong>

 

How do I modify the above code to show + instead of -- which it does at the moment?

 

Many thanks for your help

 

Pete

Link to comment
https://forums.phpfreaks.com/topic/220492-changing-from-minus-to-plus/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.