Convert milliseconds to minutes+seconds format
by Bryce · 06/30/2012 (10:17 pm) · 5 comments
Without further ado, function:
...One hundred words, eh? CAPS LOCK IS CRUISE CONTROL FOR COOL CAPS LOCK IS CRUISE CONTROL FOR COOL CAPS LOCK IS CRUISE CONTROL FOR COOL CAPS LOCK IS CRUISE CONTROL FOR COOL CAPS LOCK IS CRUISE CONTROL FOR COOL CAPS LOCK IS CRUISE CONTROL FOR COOL.
function millisecondsToMinutesSeconds(%time)
{
%te = %time / 1000;
%te = %te / 60;
%decimal = %te - mFloor(%te);
%seconds = %decimal * 60;
%minutes = %te - %decimal;
%minutes = mCeil(%minutes);
%seconds = mCeil(%seconds);
return %minutes @ " minutes and " @ %seconds @ " seconds";
}...One hundred words, eh? CAPS LOCK IS CRUISE CONTROL FOR COOL CAPS LOCK IS CRUISE CONTROL FOR COOL CAPS LOCK IS CRUISE CONTROL FOR COOL CAPS LOCK IS CRUISE CONTROL FOR COOL CAPS LOCK IS CRUISE CONTROL FOR COOL CAPS LOCK IS CRUISE CONTROL FOR COOL.
#2
07/01/2012 (8:35 am)
Looks like he got bitten by the edit bug that replaces certain characters, especially quotes, with formatting garbage in the return line.
#3
07/01/2012 (9:04 am)
Quotes and Ampersands ... the bane of mankind since the dawn of time ... but only if he presses edit ...
#4
Is what he meant - if you edit a post and use quotes, those quotes will be dropped and the " html version will be dropped in as placeholders (don't know why), so if you have to edit a post you should make it a habit to check for this before updating.
07/01/2012 (11:53 am)
562000 milliseconds is friendly to this human....return %minutes @ " minutes and " @ %seconds @ " seconds";
Is what he meant - if you edit a post and use quotes, those quotes will be dropped and the " html version will be dropped in as placeholders (don't know why), so if you have to edit a post you should make it a habit to check for this before updating.
#5
07/02/2012 (10:31 am)
@Richard Ah ok, i didn't realize that the html did that when he posted haha. Thanks for clarifying that, because I was looking at his other resources and it seemed to me that he knew how to code :P. 
Torque 3D Owner JeffH
return %minutes SPC %seconds;