Ruby on Rails
Monday, January 19, 2015
The values you see changing, like "4add7d0" aren't actually the decimal value, they are the "address". The actual decimal value is .9E0 so between each of those the *value* is the same. See http://www.ruby-doc.org/stdlib-2.1.1/libdoc/bigdecimal/rdoc/BigDecimal.html#method-i-inspect for more information. Try using ".to_s" to see just the decimal value.
On Mon, Jan 19, 2015 at 8:04 AM, Psycho Shine <anndrew78@gmail.com> wrote:
hello all.--I was noticed that BigDecimal attribute in my db row changing every reloading.sum: #<BigDecimal:4add7d0,'0.9E0',9(36)>ctrl+rsum: #<BigDecimal:639f200,'0.9E0',9(36)>ctrl+rsum: #<BigDecimal:594ceb0,'0.9E0',9(36)>Is it ok?
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7ed48cd2-bb8c-493c-aa10-4663861f7b97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Daniel Evans
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAD2%3DUWVG8sLjhwzNm4j1ppOmRNP7o8CNXjp-g-6NHTcpdmv61Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment