MakeWebGames

# Minute Converter [NEEDED] Will Pay

## Recommended Posts

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.

##### Share on other sites

```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 by Death_
put it in [code] tags
##### Share on other sites

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.

##### Share on other sites

looked it over and it appears I put flipped my ternary, try whats there now :)

##### Share on other sites

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.

##### Share on other sites

Hey just edited it, I forgot to include which line, my bad.

##### Share on other sites

I'm sorry about that wait, updated, tested, and working now. enjoy :)

##### Share on other sites

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.

##### Share on other sites

Not a problem Blade Maker. :)

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• #### Marketplace

• Discord Chat
• PBBG Directory
×
• Create New...