[Python-Dev] Re: Decimal data type issues

Batista, Facundo FBatista at uniFON.com.ar
Mon Apr 19 09:11:33 EDT 2004


[Kevin Jacobs]

#- Python decimals would do well to support the creation of 
#- instances with 
#- fixed scale
#- and precision parameters, since this information will be what is 
#- provided by databases,
#- other financial and engineering applications, and schema.  
#- i.e., these 
#- parameters override
#- the natural scale and precision found in the literal values 
#- used when 
#- constructing decimals.
#- e.g., hypothetically:
#- 
#-   Decimal('2.4000', precision=2, scale=1) == Decimal('2.4')
#-   Decimal('2.4', precision=5, scale=4) == Decimal('2.4000')
#- 
#- Remember, these literals are frequently coming from an 
#- external source 
#- that must
#- be constrained to a given schema.  This issue doesn't come up with 
#- floating point
#- numbers nearly as often, because those schema use explicitly 
#- precision-qualified
#- types (i.e., single, double, quad precision).

I like it a lot, but not for Decimal.

Money maybe will get something like this.

.	Facundo



More information about the Python-Dev mailing list