Skip to content
Browse files

Clarify decimal precision and scale options.

  • Loading branch information...
1 parent b810349 commit 143fbbddbbce84f44434c58828e2a537553e69ea @FooBarWidget FooBarWidget committed Sep 13, 2008
View
6 activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -341,6 +341,12 @@ def [](name)
# * <tt>:scale</tt> -
# Specifies the scale for a <tt>:decimal</tt> column.
#
+ # For clarity's sake: the precision is the number of significant digits,
+ # while the scale is the number of digits that can be stored following
+ # the decimal point. For example, the number 123.45 has a precision of 5
+ # and a scale of 2. A decimal with a precision of 5 and a scale of 2 can
+ # range from -999.99 to 999.99.
+ #
# Please be aware of different RDBMS implementations behavior with
# <tt>:decimal</tt> columns:
# * The SQL standard says the default scale should be 0, <tt>:scale</tt> <=

0 comments on commit 143fbbd

Please sign in to comment.
Something went wrong with that request. Please try again.