Ruby on Rails
Thursday, March 1, 2012
On Thu, Mar 1, 2012 at 2:05 AM, John Merlino <stoicism1@aol.com> wrote:
Do yourself a favor and change your migration with a line like this:
t.decimal :number, :precision => 10, :scale => 3
That's all it takes to use decimals (with 3 digits following the decimal point)
in the database too.
HTH,
Peter
-- thanks for responses, the ultimate goal was just to ensure a list of
500 (no more or less) unique random decimals that are 3 places which
would be generated only one time. Currently I'm storing them as a float
in the mysql database.
Do yourself a favor and change your migration with a line like this:
t.decimal :number, :precision => 10, :scale => 3
That's all it takes to use decimals (with 3 digits following the decimal point)
in the database too.
HTH,
Peter
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment