Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
VisualNEO Web 2018.12.15
SentiMask SDK Trial 1.0.0
OrgChart JS 4.6.4
dotConnect for BigCommerce 1.8
FedEx Smart Shipping For Magento 1.0.0
Database Workbench Pro 5.6.2.311
Taxi App Development 7.3
RentALL-Airbnb clone script 1.8.0
PHP Ecommerce Script 1.3.2
dbForge Studio for PostgreSQL 2.1
Rentonn - Airbnb clone 1.0
VisualNEO for Windows 18.08.31.0
SentiVeillance SDK Trial 7.0.191272
dbForge SQL Complete 6.1
Uber for E-Scooters 1.0
Top Code
webmoney - Webmoney payment gateway 5.x-1.2
La Caixa payment gateway 5.x-1.x-dev
Azizi search engine script PHP 4.1.10
Online Poker Script 1.0
Efficient K-Means Clustering using JIT 1.0
Fast K-means 1.0
Kernel k-means 1.0
Top Rated
VisualNEO Web 2018.12.15
Paste phpSoftPro 1.4.1
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
PHP GZ Blog Script 1.1
ATN Jobs Software 4.0
Format number function 
File ID: 65609






Format number function 
Download Format number function http://code.activestate.com/recipes/499351-format-number-function/?in=lang-pythonReport Error Link
License: Freeware
Downloads: 0
Submit Rating:
Format number function  Description
Description: 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.

License: Freeware

Related: Algorithms

O/S:Windows

Downloads: 0



More Similar Code

The Format Number API module provides a method to configure number formats (site default and user defined) with configurable decimal point and thousand separators.

Since 6.x-1.6: This module also provides the 'numericfield' Forms API element, which is a right aligned text input element that allows the user enter numbers using the configured thousands separator and decimal point (site default or user defined). This Forms API element...



Overview

The Formatted Number CCK module defines numeric types where thousands separator and decimal point are inherited from the Format Number API module.

Numeric types supported: signed or unsigned integers (tiny, small,...



Prints the current line number, function name and some text. Useful for debugging.



A function to convert decimal integer numbers, (from 0 to 255), into byte(s) format.
Another function calling the above function to convert ASCII strings into byte(s) format.

Python 3.1.3 (r313:86834, Nov 28 2010, 10:01:07)



This string manipulation article lets you know the steps needed to convert the text in proper case format. The function PropCase() is illustrated with an example program how to capitalize the starting letter of each word that are passed through an...



The 'London Comedy Gigs' plugin will display a constantly updating list of comedy gigs in the capital, with all the big name comedians, little stand-up shows and West End theatre runs.

The listing will include a title, description and...



A function to convert a number to a more readable format by adding thousands separators.

This very simple function lets you choose the thousands separator character and the number of decimal spaces to return. Any character (including...



This includes a function to read in the standard flow cytometry FCS format data and examples of how to visualize the data.



M-file that calculate weeknumber based on a date. Date can be given as scalar or a vector. Datevalues can also be provided as textvalues, but then must a second variable describing the that format also be read in.

In addtion can a third...



This plugin creates a function called "my_akismet_count();" which will return a sentence like the following:

Akismet has protected my blog from 468 spam comments. Nice try!

Provided you have Akismet installed, it...

User Review for Format number function
- required fields
     

Please enter text on the image