Having trouble writing a string to convert the millisecond timer from a Do More to an HH:MM format on a Red Lion G315. Have tried writing the string in the Do More however, it will not transfer to the Red Lion.
This is a *very* simple program to convert seconds to mm:ss. You can modify it to work with milliseconds pretty easily. I have written more complex and better versions, but this should get you started. Arg1 is an integer passed to the program in Integer format. It includes the ability to modify it to include hours.
I haven't used this version in years, so play with it to verify it works in all situations - as I said, I have made more complicated ones than this, but I think it meets your needs. This should be called from a String Tag and the parameter passed should be an Integer Tag in seconds. I would think you could just divide milliseconds by 1000.
//converts a value in seconds to a string formatted "mm:ss"
//declare local variables
cstring val;
int hours;
int minutes;
int seconds;
//convert argument (Arg1)to hours, minutes, and seconds
hours = Arg1 / 3600;
minutes = (Arg1 % 3600) / 60;
seconds = Arg1 % 60;
//put the current run time total into mm:ss format
val = IntToText(minutes, 10, 2) + ":" + IntToText(seconds, 10, 2);
return val;