Signature (Visual Basic / VBA)
Public Function DecimalToHMS( _
ByVal vDecimalHours As Variant _
) As Variant
Code Example
DecimalToHMS(4.5555) = 4.33198
DecimalToHMS( 4.76) = 4.4536
DecimalToHMS(-4.76) = -4.4536
Parameters
| Parameter | Description |
|---|---|
| vDecimalHours | A floating-point number which represents a number of hours. For example, .5 represents 1/2 hour or 30 minutes. Function returns Null if vDecimalHours is Null or cannot be fixed up to a number. |
Return Value
The return value will (usually) be a number in which the integer part represents hours, the first two floating point digits represent minutes, the next two digits represent seconds, and the remaining digits represent a fractional number of seconds.