sidpy.base.string_utils.format_time¶
- sidpy.base.string_utils.format_time(time_in_seconds, decimals=2)[source]¶
Formats the provided time in seconds into seconds, minutes, or hours
- Parameters:
time_in_seconds (number) – Time in seconds
decimals (uint, optional. default = 2) – Number of decimal places to which the time needs to be formatted
- Returns:
String with time formatted correctly
- Return type:
Examples
>>> import sidpy >>> num_secs = 14497.34 >>> time_form = sidpy.string_utils.format_time(num_secs) >>> print('{} seconds = {}'.format(num_secs, time_form))