Created
October 6, 2020 20:25
-
-
Save leventeren/43722ca13676048dc00c7c74de805749 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetMinuteTime(float time) | |
{ | |
int mm,ss; | |
string stime = "0:00"; | |
if (time<=0) return stime; | |
mm = (int)time/60; | |
ss = (int)time%60; | |
if(mm>60) | |
stime = "59:59"; | |
else if (mm <10 && ss >=10) | |
{ | |
stime = "0" + mm + ":" + ss; | |
}else if (mm<10&&ss<10) | |
{ | |
stime = "0"+mm+":0"+ss; | |
}else if (mm>=10&&ss<10) | |
{ | |
stime = mm+":0"+ss; | |
} | |
else | |
{ | |
stime= mm+":"+ss; | |
} | |
return stime; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment