#NEWLINE# def round_number( count , keep_width = False ) : #NEWLINE# #INDENT# "\n    Round a floating point number to two decimal places in a human friendly format.\n\n    :param count: The number to format.\n    :param keep_width: ``True`` if trailing zeros should not be stripped,\n                       ``False`` if they can be stripped.\n    :returns: The formatted number as a string. If no decimal places are\n              required to represent the number, they will be omitted.\n\n    The main purpose of this function is to be used by functions like\n    :func:`format_length()`, :func:`format_size()` and\n    :func:`format_timespan()`.\n\n    Here are some examples:\n\n    >>> from humanfriendly import round_number\n    >>> round_number(1)\n    '1'\n    >>> round_number(math.pi)\n    '3.14'\n    >>> round_number(5.001)\n    '5'\n    " #NEWLINE# text = ( '%.2f' % float ( count ) ) #NEWLINE# if ( not keep_width ) : #NEWLINE# #INDENT# text = re . sub ( '0+$' , '' , text ) #NEWLINE# text = re . sub ( '\\.$' , '' , text ) #NEWLINE# #UNINDENT# return keep_width