Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
10014 Weergaven

i use fields.float and it comes out double precision

how can i make a numeric field?


Avatar
Annuleer
Beste antwoord

An integer.

Syntax:

fields.integer('Field Name' [, Optional Parameters]),


A floating point number.

Syntax:

fields.float('Field Name' [, Optional Parameters]),

Note

The optional parameter digits defines the precision and scale of the number. The scale being the number of digits after the decimal point whereas the precision is the total number of significant digits in the number (before and after the decimal point). If the parameter digits is not present, the number will be a double precision floating point number. Warning: these floating-point numbers are inexact (not any value can be converted to its binary representation) and this can lead to rounding errors. You should always use the digits parameter for monetary amounts.

Example:

'rate': fields.float(

'Relative Change rate',

digits=(12,6) [,

Optional Parameters]),

Avatar
Annuleer