Simple ? (Solved)
Moderator: General Moderators
Simple ? (Solved)
Without makin quite a messy bit of substr lastindexof etc... peice of code, is there a way to get a number to have x amount of trailing 0's. Because for a price i'm getting £1.4 and I want £1.40. I know theres functions in other languages to do this, is there in Php?
Last edited by malpass on Sun Mar 21, 2004 3:55 am, edited 1 time in total.
-
starsol
- Forum Newbie
- Posts: 24
- Joined: Thu Jul 31, 2003 8:30 am
- Location: Norfolk, England.
- Contact:
Try:
Code: Select all
$price = sprintf("%01.2f", $price);