2011-03-05 94 views

回答

2

是否這樣?

function toHourMin(minutes) 
    hours = minutes \ 60 
    minutes = minutes mod 60 

    toHourMin = hours & iif(hours=1," hour"," hours") & " and " & minutes & iif(minutes=1," minute"," minutes") 
end function 

function iif(condition, truepart, falsepart) 
    if condition then 
     iif = truepart 
    else 
     iif = falsepart 
    end if 
end function 

注意這將返回象輸出:

0 hours and 0 minutes 

如果不期望的行爲,你應該說明,當你在不同的時間(小)金額應通過發生什麼。

傳遞90將返回你問什麼:

1 hour and 30 minutes