Link to home
Start Free TrialLog in
Avatar of joshordan
joshordan

asked on

Formatting a number being displayed

I am customising a script and I have not really used perl/cgi before. I have a price which is displayed. The code looks like:

<td>Total Price</td>
  <td><b>UK£ $price</b>

If $Price is 10.46, it is displayed correctly but if $Price is 10.40 it is displayed like 10.4 missing the zero. Any ideas how I can format this number to be displayed correctly everytime.
ASKER CERTIFIED SOLUTION
Avatar of apparition
apparition

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of joshordan
joshordan

ASKER

Worked a treat. Many thanks
You are welcome