Jump to content

[SOLVED] Showing a "£" sign


stublackett

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,

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.