Jump to content

Help with Plus and Minus


Riparian

Recommended Posts

Thanks for the help but finally got it working with the following

 

<OPTION VALUE="<?=$x?>"><?php printf('%0+2.2f', $x)?></OPTION>

 

For others this displays a plus in front of positive numbers only  (the 2.2 is the decimal points required)

 

$x is the display value I was chasing

 

Hope it helps someone

 

Cheers

 

 

why dont you use the html code for +

+

 

^^^ That has nothing to do with it. ^^^

 

Assuming this is within an echo statement, you need to concatenate the function's output into the string.

echo "<option>" . printf('%0+4.2f',$x) . "</option> ';

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.