API:TimeUtils.FormatTimeCondensed

From TheWarWiki

Jump to: navigation, search
Parent: TimeUtils - Return to API listing


No description available.

Usage

This function has not yet had its usage documented.

This method does not take any known arguments.

This method does not return any known values.

Source Code

function TimeUtils.FormatTimeCondensed(time)
    if not (time > 0) then
        time = 0
    end
    
    local timeString = L""
    
    if( time > (TimeUtils.SECONDS_PER_DAY *1.5) ) then 
        timeString = GetStringFormat( StringTables.Default.LABEL_X_D, { math.floor( (time / TimeUtils.SECONDS_PER_DAY) + 0.5 ) } )
    elseif( time > (TimeUtils.SECONDS_PER_HOUR *1.5) ) then 
        timeString = GetStringFormat( StringTables.Default.LABEL_X_H, { math.floor( (time / TimeUtils.SECONDS_PER_HOUR) + 0.5 ) } )
    elseif( time > (TimeUtils.SECONDS_PER_MINUTE *1.5) ) then 
        timeString = GetStringFormat( StringTables.Default.LABEL_X_M, { math.floor( (time / TimeUtils.SECONDS_PER_MINUTE) + 0.5 ) } )
    else
        timeString = GetStringFormat( StringTables.Default.LABEL_X_S, { math.floor( time + 0.5 ) } )
    end
    
    return timeString
end
--Upload by Lliane, <sdepiets@gmail.com> 2008/08/21


Personal tools