开发者

RAILS precision and scale of decimal is not working

I have set :precision => 8, :scale => 2 in decimal of migration but when i input 1923.423453 it is still 开发者_如何学C 1923.4 . It should be 1923.42 ... right?

t.decimal :value , :precision => 8, :scale => 2 , :default => 0


Apparently all sqlite options are dropped on migration.

Here's the lighthouse ticket targeting milestone 3.0.4 to fix this issue: https://rails.lighthouseapp.com/projects/8994/tickets/2872-patch-sqlite3-adapter-drops-decimal-columns-precision-scale-when-migration-tries-to-alter-them

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜