def get_formatted_size( totsizebytes ):
    """
    This routine spits out a nice, formatted string representation of a file size, which is represented in int.
    
    This method works like this.

    .. code:: python
       
       get_formatted_size( int(2e3) ) = '1.953 kB' # kilobytes
       get_formatted_size( int(2e6) ) = '1.907 MB' # megabytes
       get_formatted_size( int(2e9) ) = '1.863 GB' # gigabytes

    Args:
        totsizebytes (int): size of a file in bytes.
    
    Returns:
        str: Formatted representation of that file size.

    .. seealso:: :py:meth:`get_formatted_size_MB <howdy.core.get_formatted_size_MB>`.
    """
    
    sizestring = ''
    if totsizebytes >= 1024**4:
        size_in_tb = totsizebytes * 1.0 / 1024**4
        sizestring = '%0.3f TB' % size_in_tb
    elif totsizebytes >= 1024**3:
        size_in_gb = totsizebytes * 1.0 / 1024**3
        sizestring = '%0.3f GB' % size_in_gb
    elif totsizebytes >= 1024**2:
        size_in_mb = totsizebytes * 1.0 / 1024**2
        sizestring = '%0.3f MB' % size_in_mb
    elif totsizebytes >= 1024:
        size_in_kb = totsizebytes * 1.0 / 1024
        sizestring = '%0.3f kB' % size_in_kb
    return sizestring