I have an odd bug in one of my applications. When I am using the sqlite3 database the bug is not present. However when I use mysql2 as the database adapter I run into an error saving decimal values from a form. If I submit the value 19.99 my input after the decimal is removed and it is stored in the database as 19.00 What would cause this? The database has the correct settings for the column and I can create a correct record using the rails console. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sent from my iPhone On May 14, 2011, at 11:26 PM, Devin M <devinmrn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have an odd bug in one of my applications. When I am using the > sqlite3 database the bug is not present. However when I use mysql2 as > the database adapter I run into an error saving decimal values from a > form. If I submit the value 19.99 my input after the decimal is > removed and it is stored in the database as 19.00 > > What would cause this? The database has the correct settings for the > column and I can create a correct record using the rails console. >What does your migration file, model and code you are creating the record look like? You need to provide something that the group can use as a reproducible test case so we can help you. B.> -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> What would cause this? The database has the correct settings for the > column and I can create a correct record using the rails console.The only column type that works is "decimal" is that your case? And gimme a link to your app so that I''ll make it crash by inputting decimal values that have a comma ;) I had to go through this pain for my http://suivauto.com website that uses the French "," instead of the "." for decimal points. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, May 15, 2011 at 1:52 PM, Fernando Perez <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> > What would cause this? The database has the correct settings for the > > column and I can create a correct record using the rails console. > > The only column type that works is "decimal" is that your case? > > And gimme a link to your app so that I''ll make it crash by inputting > decimal values that have a comma ;) > > I had to go through this pain for my http://suivauto.com website that > uses the French "," instead of the "." for decimal points. >To be sure, in your migration you have the precision and scale for the column? t.decimal "amount", :precision => 10, :scale => 2> > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.