def locale_format_number(val):
try:<EOL><INDENT>return locale.format('<STR_LIT>', val, <NUM_LIT:1>)<EOL><DEDENT>except UnicodeDecodeError:<EOL><INDENT>return '<STR_LIT>'.format(val) <EOL>
Depend on users local, so no active doctest here ;)

> locale_format_number(1234567.89)
'1.234.567.890'