Y
Hacker News
new
|
ask
|
show
|
jobs
by
knightni
4572 days ago
You're running into the fact that Postgres doesn't automatically cast ints to floats - so 1/50 = 0. Try using 1.0/50.0 instead.
1 comments
SDGT
4572 days ago
Or get dirty and cast it.
::floatval
link
::floatval