I have a script that uses eBay's API and when it displays the prices it drops the last zero in the cents area. Example: shows: $10.5 should be: $10.50 Does anyone know if I can make a change to my script to display all of the numbers? I posted the same question on Ebay's forum and I rec'd this answer: Add the 0 yourself. If you are using PHP use number_format(). However, I don't know where to put this code and how to implement it. Also, will it add a 0 to all ending prices correctly. So if it's $9.99 will it show $9.990? Any help would be greatly appreciated.
This isnt really an ebay API question, its just using the PHP function which you have been referred to already - Its all detailed in the reference site; http://php.net/manual/en/function.number-format.php I.E <?php $yourprice = "15.6"; $yourprice = number_format($yourprice, 2, '.', ''); print $yourprice; ?> PHP: OUTPUT: 15.60 It will not add a zero onto the end of decimalized numbers; <?php $yourprice = "15.60"; $yourprice = number_format($yourprice, 2, '.',''); print $yourprice; ?> PHP: OUTPUT: 15.60