Decimal precision SQLAlchemy

See the sqlalchemy documentation for an example:

class sqlalchemy.types.DECIMAL(precision=None, scale=None, asdecimal=True) 

What values ​​other than None can you use for accuracy? I do not understand how to adjust decimal precision.

+7
python sqlalchemy
source share
1 answer

From the documentation

precision - numeric precision for use in DDL CREATE TABLE

If you want to know what values ​​are possible, check the W3C data types for SQL: http://www.w3schools.com/sql/sql_datatypes_general.asp

In this case:

DECIMAL (p, s): exact numerical value, accuracy p, scale s. Example: decimal (5,2) is a number that has 3 digits before decimal and 2 digits after decimal

+12
source share

All Articles