Login | Register
My pages Projects Community openCollabNet

Discussions > dev > [propel-dev] Creole API change! getPrecision() -> getScale()

Discussion topic

Back to topic list

[propel-dev] Creole API change! getPrecision() -> getScale()


Author hlellelid
Full name Hans Lellelid
Date 2004-01-14 09:08:39 PST
Message Before adding precision/scale support to Propel, I'm renaming the method
in creole.metadata.ColumnInfo from getPrecision() to getScale().

While developers often refer to precision as number of digits allowed
after decimal point, databases seem to agree that this is actually called
"scale". "Precision" refers to the total number of digits allowed for a

I'm going to simply remove getPrecision() rather than change the return
value to total digits -- as we can access total digits using getSize(),
and I don't want to make it more confusing.

>From MSSQL site:

Precision is the number of digits in a number. Scale is the number of
digits to the right of the decimal point in a number. For example, the
number 123.45 has a precision of 5 and a scale of 2.

>From MySQL site:

    salary DECIMAL(5,2)

In this example, 5 (precision) represents the number of significant
decimal digits that will be stored for values, and 2 (scale) represents
the number of digits that will be stored following the decimal point. In
this case, therefore, the range of values that can be stored in the salary
column is from -99.99 to 99.99. (MySQL can actually store numbers up to
999.99 in this column because it doesn't have to store the sign for
positive numbers)


So, I think that decides it. I will add some comments to phpdoc for the
getScale() method. Also, we'll be calling it "scale" in Propel. Which
probably makes sense since that's what Torque is/will be calling it.


To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
For additional commands, e-mail: dev-help at propel dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »


Show all messages in topic

[propel-dev] Creole API change! getPrecision() -> getScale() hlellelid Hans Lellelid 2004-01-14 09:08:39 PST
Messages per page: