public static str 5 num2Time(real _hours)
{
int realPart;
int decimalPart;
real hours;
str hoursStr;
str minStr;
int decimalLocation;
str finalMinutes;
;
try
{
hours = _hours;
hoursStr = num2str(hours, 0, 2, 1, 0);
decimalLocation = strfind(hoursStr, ".", 0, strlen(hoursStr));
hoursStr = substr(hoursStr, 0, decimalLocation);
hoursStr = trimString(hoursStr, ["."]);
minStr = num2str(hours, 0, 2, 1, 0);
minStr = substr(minStr, decimalLocation, strlen(minStr) - strlen(hoursStr));
minStr = trimString(minStr, ["."]);
realPart = str2int(hoursStr);
decimalPart = str2int(minStr);
finalMinutes = hoursStr + ":" + (int2str(60 * decimalPart / 100) == "0" ? "00" : int2str(60 * decimalPart / 100));
return finalMinutes;
}
catch
{
return num2str(_hours, 0, 2, 1, 0);
}
}
{
int realPart;
int decimalPart;
real hours;
str hoursStr;
str minStr;
int decimalLocation;
str finalMinutes;
;
try
{
hours = _hours;
hoursStr = num2str(hours, 0, 2, 1, 0);
decimalLocation = strfind(hoursStr, ".", 0, strlen(hoursStr));
hoursStr = substr(hoursStr, 0, decimalLocation);
hoursStr = trimString(hoursStr, ["."]);
minStr = num2str(hours, 0, 2, 1, 0);
minStr = substr(minStr, decimalLocation, strlen(minStr) - strlen(hoursStr));
minStr = trimString(minStr, ["."]);
realPart = str2int(hoursStr);
decimalPart = str2int(minStr);
finalMinutes = hoursStr + ":" + (int2str(60 * decimalPart / 100) == "0" ? "00" : int2str(60 * decimalPart / 100));
return finalMinutes;
}
catch
{
return num2str(_hours, 0, 2, 1, 0);
}
}
This comment has been removed by the author.
ReplyDeleteI opted for a single line conversion:
ReplyDeletestrFmt("%1:%2", hours div 1, strRfix(int2str(round(abs(hours)*60,1) mod 60),2,"0"))
i done it like this tmpV = (abs(_value)*3600) mod 3600;
ReplyDeletetime = DateTimeUtil::addSeconds(time, tmpV);
ret = DateTimeUtil::time(time);
off white x jordan 1
ReplyDeletekd 15
curry 6 shoes
supreme clothing
off white
bape outlet
off white clothing
supreme outlet
yeezy boost 350
supreme
off white hoodie
ReplyDeletejordan 1
paul george shoes
giannis shoes
cheap kyrie shoes