Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity string format time

public string FormatTime( float time )
{
int minutes = (int) time / 60000 ;
int seconds = (int) time / 1000 - 60 * minutes;
int milliseconds = (int) time - minutes * 60000 - 1000 * seconds;
return string. Format("{0:00}:{1:00}:{2:000}", minutes, seconds, milliseconds );
}
 
PREVIOUS NEXT
Tagged: #unity #string #format #time
ADD COMMENT
Topic
Name
5+6 =