If you want to understand how the formatting works, you can look up “printf” on Google. Although it differs in many particulars, it’s similar in concept.
If you’re interested in just showing tenths and hundredths of seconds, that’s easy enough to do. First what you want is the number of milliseconds from 0-999. If you use “ms” the way you have it above, you’re displaying the total milliseconds elapsed, which is not what you want. You want the number of milliseconds between the two closest integer number of seconds. Like this:
local ms = floor(newfresh % 1000)
If you display the value of “ms” now, it will be 0-999, but you want 0-99, just two digits. So divide it by 10:
local hundredths = floor(ms / 10)
Now you can display 3 minutes, 4.56 seconds as 03:04.56 like this:
mytime.text = string.format("%02d:%02d.%02d", minutes, seconds, hundredths)
(I haven’t tested any of this code: I just wrote it out, so there may be some mistakes.)
[import]uid: 9659 topic_id: 5924 reply_id: 29883[/import]