def number_format(value, decimal_pos=None):
 return numberformat.format(value, get_format('DECIMAL_SEPARATOR'), decimal_pos, get_format('NUMBER_GROUPING'), get_format('THOUSAND_SEPARATOR'))

def number_format ( value , decimal_pos = None ) : return numberformat . format ( value , get_format ( 'DECIMAL_SEPARATOR' ) , decimal_pos , get_format ( 'NUMBER_GROUPING' ) , get_format ( 'THOUSAND_SEPARATOR' ) )
enforces 2 decimal places after a number if only one is given also formats comma separators every 3rd digit before decimal place .