Jump to content

Recommended Posts

Hi guys,

 

Hopefully a quick and simple answer... I've got a shopping cart script setup.

 

I'm doing the function number_format to add two decimals points after a variable, But what I need to know is how do I echo out the "£" sign into the code. As currently it shows the right amount, Just without the "£" sign appearing.

 

Here is my code

 

<?php
$subtotal = $quantity * 45.00;
$vat = ($subtotal + 3) * 0.15 ;
$vat = number_format($vat,2);
$total = $vat+ $subtotal + 3;
$total = number_format($total,2);
?>

 

Where there is a number_format I need to add the "£" sign

 

Thanks again

Link to comment
https://forums.phpfreaks.com/topic/174997-solved-showing-a-%C2%A3-sign/
Share on other sites

  • 5 months later...

Hi there,

 

I have a question about the money_format() function. I am trying to use it on a website I'm building at the moment and I have a problem with it.

 

Here is the code I use:

setlocale(LC_MONETARY, 'en_GB');
echo money_format('%.0n',$list['price'])."\n";

 

On my local server, I have no problem, the amount and symbol appear correctly. But when I upload the files on an online testing server, the "£" does not appear and leaves a question mark in a black diamond.

 

Can anyone tell me what I am doing wrong?

 

Thanks in advance.

 

Cheers,

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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