sidpy/base/string_utils.py
def format_time(time_in_seconds, decimals=2):
    """
    Formats the provided time in seconds to 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
    -------
    str
        String with time formatted correctly

    Examples
    --------
    >>> import sidpy
    >>> num_secs = 14497.34
    >>> time_form = sidpy.string_utils.format_time(num_secs)
    >>> print('{} seconds = {}'.format(num_secs, time_form))
    """
    units = ['msec', 'sec', 'mins', 'hours']
    factors = [0.001, 1, 60, 3600]
    return format_quantity(time_in_seconds, units, factors, decimals=decimals)

    Formats the provided time in seconds to 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
    -------
    str
        String with time formatted correctly

    Examples
    --------
    >>> import sidpy
    >>> num_secs = 14497.34
    >>> time_form = sidpy.string_utils.format_time(num_secs)
    >>> print('{} seconds = {}'.format(num_secs, time_form))
    
Formats the provided time in seconds to 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

str
String with time formatted correctly

Examples


Formats the provided time in seconds to 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 str String with time formatted correctly Examples
def format_time(time_in_seconds, decimals=2):
    units = ['msec', 'sec', 'mins', 'hours']
    factors = [0.001, 1, 60, 3600]
    return format_quantity(time_in_seconds, units, factors, decimals=decimals)
def format_time ( time_in_seconds , decimals = 2 ) : units = [ 'msec' , 'sec' , 'mins' , 'hours' ] factors = [ 0.001 , 1 , 60 , 3600 ] return format_quantity ( time_in_seconds , units , factors , decimals = decimals )
Formats the provided time in seconds to seconds, minutes, or hours
Parameters
Formats the provided time in seconds to seconds minutes or hours Parameters
"""
    Formats the provided time in seconds to 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
    -------
    str
        String with time formatted correctly

    Examples
    --------
    >>> import sidpy
    >>> num_secs = 14497.34
    >>> time_form = sidpy.string_utils.format_time(num_secs)
    >>> print('{} seconds = {}'.format(num_secs, time_form))
    """
time_in_seconds
decimals