<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_separators(x):
 """Format integer with separator between thousands. :param x: A number to be formatted in a locale friendly way. :type x: int :returns: A locale friendly formatted string e.g. 1,000,0000.00 representing the original x. If a ValueError exception occurs, x is simply returned. :rtype: basestring From http:// stackoverflow.com/questions/5513615/add-thousands-separators-to-a-number Instead use this: http://docs.python.org/library/string.html#formatspec """

    try:
        s = '{0:,}'.format(x)
        # s = '{0:n}'.format(x)  # n means locale aware (read up on this)
    # see issue #526
    except ValueError:
        return x

    # Quick solution for the moment
    if locale() in ['id', 'fr']:
        # Replace commas with the correct thousand separator.
        s = s.replace(',', thousand_separator())
    return s