Number Format 1'000.00
How can I show my numbers with the following format: 1'000.00
How can I show my numbers with the following format: 1'000.00
The number_format function allows you to set the decimal and thousands separator. You can use that to get the number to display how you want like:
number_format ([your number],2 ,".","'");
Thanks Ray. But I meant for the cart formats like:
<?php echo WA_eCart_DisplayMoney($eCartMyCart, $eCartMyCart->DisplayInfo("TotalPrice")); ?>
Unfortunately the eCart only offers native US and European number formats. To use yours you would have to us number_format() like:
<?php echo number_format($eCartMyCart->DisplayInfo("TotalPrice"),2 ,".","'"); ?>
That works, thanks Ray.
How do I use it here?
<?php echo WA_eCart_DisplayMoney($eCartMyCart, $eCartMyCart->GrandTotal()); ?>
Yes, same thing:
<?php echo number_format($eCartMyCart->GrandTotal(),2 ,".","'"); ?>
Hi,
I can't figure out why the folowing is not working.
<?php echo WA_eCart_DisplayMoney($eCart1,$getOrderDet->getColumnVal("DetailPrice")); ?>
I have used the same techinque many times and I had no problems. Can't figure out why it is not working on a concrete page.
I am usign a query to display order history. Severak times before I was just including the Ecart Files and the GetContent function. Then I was applying the WA_eCart_DisplayMoney in any value I wanted to tranform based on my Ecart settings.
As I told I did this many times and it is working. For some reason it is not working in a specific page and can't understand why.
Thank you
What is it displaying? Is there an error? can you show the price without formatting?
<?php echo $getOrderDet->getColumnVal("DetailPrice"); ?>
Do you have the eCart1 object on the page?
Try just using the number_format() function.
<?php echo number_format($getOrderDet->getColumnVal("DetailPrice")); ?>
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.