Forums

PHP

This topic is locked

Formatting for £s

Posted 09 Jun 2003 22:23:51
1
has voted
09 Jun 2003 22:23:51 tom dood posted:
I am having a rediculous amount of difficulty trying to format 4 digit numbers - eg 1995 into prices - eg 19.95.

What have I missed ? None of the other DWMX formats I tried could do it.

Won't let me have the left-hand 2 digits as decimal points - ie pennies.

Can anyone suggest a solution?

many thanks

Replies

Replied 09 Jun 2003 22:46:00
09 Jun 2003 22:46:00 kamm k replied:
How about;

<pre id=code><font face=courier size=2 id=code>$dec = (1995/100);
echo $dec;
</font id=code></pre id=code>

or in other words;
<pre id=code><font face=courier size=2 id=code>echo ($row_rsPrice['price']/100);
</font id=code></pre id=code>

kamm...
Replied 10 Jun 2003 11:49:52
10 Jun 2003 11:49:52 tom dood replied:
That was so simple - thanks a million /100 !

Reply to this topic