EY Posted March 10, 2008 Share Posted March 10, 2008 Alright i got a question about sprintf: $price = 25; $f_price = sprintf(“%01.2f”,$price); echo “$f_price”; So what this means is i name a variable like i would always $price = 25; Now what i need explanation is with $f_price Do i just choose any other variable and put it there/. Can anyone explain the function of that being there. And this piece of code is always the same right? sprintf("%01.2f" And at the end i put ,and the variable i choose in first place. Please tell me if this is right and also about the part i do not understand. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
dotBz Posted March 11, 2008 Share Posted March 11, 2008 http://php.net/sprintf Hope that helps.. Quote Link to comment Share on other sites More sharing options...
EY Posted March 11, 2008 Author Share Posted March 11, 2008 Can anyone tell me what i have said was right or not please. Quote Link to comment Share on other sites More sharing options...
discomatt Posted March 11, 2008 Share Posted March 11, 2008 I have no idea what you're trying to accomplish. Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted March 11, 2008 Share Posted March 11, 2008 you are using wierd quotes $f_price = sprintf(“%01.2f”,$price); do this: $f_price = sprintf("%01.2f",$price); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.