Blade Maker Posted May 22, 2011 Share Posted May 22, 2011 Okay well I need a minute converter function made, I do not know the right technique to do it, so I am willing to pay. I need it to be as simple as just doing this: min_converter(60); then it would ouput, of course 1 Hour. But say I inputed 61, it would say 1 Hour(s) and 1 Minute(s) (the s in the () are there just incase you don't know how to make it without the S if there is only 1) If its 1440 it would output 1 Day. If its 1441 it would output 1 Day and 1 Minute, if its 1501 it would output 1 Day, 1 Hour and 1 Minute. The text of the output does not have to be exactly like that, but if you can make it like that, then that is a plus. I would really only input 10080 minutes as the max which should output: 1 Week. But if you can make it go up to years, then that is a big plus for me, so it would be like 1 year, and 1 month, or such, you get the point. Anyways name a price but I am looking to pay around $7 if that is what its worth. If you have questions, or are confused, read it again, if you still are confused, contact me. Thanks guys, just message me on the forum or post on this thread. Quote Link to comment Share on other sites More sharing options...
Pitch Black Posted May 22, 2011 Share Posted May 22, 2011 (edited) function min_converter($x) { unset($uw,$ud,$uh,$um); if(($x/10080) >= 1){ $w=floor($x/10080); $uw=$w." Week(s) "; $x=$x-(floor($x/10080)*10080);} if(($x/1440) >= 1){ $d=floor($x/1440); $ud=$d." Day(s) "; $x=$x-(floor($x/1440)*1440);} if(($x/60) >= 1){ $h=floor($x/60); $uh=$h." Hour(s) "; $x=$x-(floor($x/60)*60);} if($x >= 1){ $um=$x." Minute(s) "; } return $uw.$ud.$uh.$um; } should work :) Edited May 22, 2011 by Death_ put it in [code] tags Quote Link to comment Share on other sites More sharing options...
Blade Maker Posted May 22, 2011 Author Share Posted May 22, 2011 Umm small errors, I would be able to fix if I were better at time/math, but can I add you on MSN so we can fix this please? Btw thanks for helping out also. Quote Link to comment Share on other sites More sharing options...
Pitch Black Posted May 22, 2011 Share Posted May 22, 2011 looked it over and it appears I put flipped my ternary, try whats there now :) Quote Link to comment Share on other sites More sharing options...
Blade Maker Posted May 22, 2011 Author Share Posted May 22, 2011 (edited) Parse error: syntax error, unexpected ';' on line 2 Mind if I get your MSN you seem neat, and I might be able to use you, like payed work, or just general chatting. Edited May 22, 2011 by Blade Maker Quote Link to comment Share on other sites More sharing options...
Blade Maker Posted May 22, 2011 Author Share Posted May 22, 2011 Hey just edited it, I forgot to include which line, my bad. Quote Link to comment Share on other sites More sharing options...
Pitch Black Posted May 22, 2011 Share Posted May 22, 2011 I'm sorry about that wait, updated, tested, and working now. enjoy :) Quote Link to comment Share on other sites More sharing options...
Blade Maker Posted May 22, 2011 Author Share Posted May 22, 2011 (edited) Thank you very much Death_, its not easy programming in the middle of the night, but you never gave up and you finished it that night for me. I really appreciate you doing this for me, and even when I offered money you turned it down and programmed it for free :) Thank you for programming this the same day I posted this thread, and thank you for not giving up, A++ man. Edited May 22, 2011 by Blade Maker Quote Link to comment Share on other sites More sharing options...
Pitch Black Posted May 22, 2011 Share Posted May 22, 2011 Not a problem Blade Maker. :) 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.