Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4623

Rails PostgreSQL numeric field overflow ERROR

$
0
0

I have a decimal field for price on my schema and every time that i try to insert the price the pg comes with this ERROR. anybody could give me any light? thank's

configuration

t.decimal  "price",  :precision => 2, :scale => 2

ERROR

PG::Error: ERROR:  numeric field overflowDETAIL:  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"

Viewing all articles
Browse latest Browse all 4623


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>