'Change the format of the number depending on the language
Based on https://code.djangoproject.com/browser/django/trunk/django/utils/numberformat.py
@param number: the number
@param precision: the number of decimal places to show
@param fixed: show decimal places even if the decimal part is 0'

@staticmethod
def represent(number, precision=None, fixed=False):

    if (number is None):
        return ''
    DECIMAL_SEPARATOR = current.deployment_settings.get_L10n_decimal_separator()
    str_number = unicode(number)
    if ('.' in str_number):
        (int_part, dec_part) = str_number.split('.')
        if (precision is not None):
            dec_part = dec_part[:precision]
    else:
        (int_part, dec_part) = (str_number, '')
    if (dec_part and (int(dec_part) == 0) and (not fixed)):
        dec_part = ''
    elif (precision is not None):
        dec_part = (dec_part + ('0' * (precision - len(dec_part))))
    if dec_part:
        dec_part = (DECIMAL_SEPARATOR + dec_part)
    int_part = IS_INT_AMOUNT.represent(int(int_part))
    return (int_part + dec_part)
