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. Link to comment https://forums.phpfreaks.com/topic/95524-sprintf-help/ Share on other sites More sharing options...
dotBz Posted March 11, 2008 Share Posted March 11, 2008 http://php.net/sprintf Hope that helps.. Link to comment https://forums.phpfreaks.com/topic/95524-sprintf-help/#findComment-489023 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. Link to comment https://forums.phpfreaks.com/topic/95524-sprintf-help/#findComment-489096 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. Link to comment https://forums.phpfreaks.com/topic/95524-sprintf-help/#findComment-489097 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); Link to comment https://forums.phpfreaks.com/topic/95524-sprintf-help/#findComment-489148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.