Format number function


Version: 1.1
Date: 2013-09-12
Category:
Scripts
Python
Requirements:
Seller:
Price:
-
System:
Requirements:
License:

Description - Format number function



For many languages it is possible to use the locale module to format numbers. But there are at least three languages for which the locale.localeconv()[`thousands_sep`] is empty: Brazilian portuguese - `pt_br`, portuguese - `pt` and spanish - `es`. The first function, format_positive_integer() will return the passed integer number as a String with the thousands group separator added. The second function, format_number() much more generic, will accept any number, integer or float, positive or Negative, and return a string with the thousands group separator and the desired Precision.



More in Python-Format number function

Group Separator Format Number Thousands Group Separator