I am currently using the code below to generate the product price as part of the Open Graph meta tag on our site:
The above code generates the price just fine and you can see it by viewing the source on our site from my signature below. However, the price that is generated shows 4 decimal place instead of two. Something like 10.9900 or 10.4900 (or whatever the 4 decimal place resulted in). I am looking for assistance to rewrite this to format it so it only shows 2 decimal place.PHP Code:
<?php if (isset($_GET['products_id'])) {
$cs_price = $product_info_metatags->fields['products_price_sorter'];
?>
<meta property="og:price:amount" content="<?php echo $cs_price; ?>" />
<?php
}
?>
Thanks!
Bookmarks