我的架构上有一个十进制的价格字段,每次我尝试插入价格时,pg 都会出现此错误。任何人都可以给我任何光吗?谢谢
配置
t.decimal "price", :precision => 2, :scale => 2
错误
PG::Error: ERROR: numeric field overflow
DETAIL: A field with precision 2, scale 2 must round to an absolute value less than 1.
: INSERT INTO "items" ("category_id", "name", "price", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) RETURNING "id"