pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Round Numeric Type
3+ messages / 2 participants
[nested] [flat]

* Round Numeric Type
@ 2006-10-31 19:35  Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Ezequias Rodrigues da Rocha @ 2006-10-31 19:35 UTC (permalink / raw)
  To: pgsql-sql

Hi list,

I did a trigger to update a points on a table but in some cases the
PostgreSQL does a round of my Numeric like.

If >= 0.5 so postgresql puts 1
If < 0.5 so postgresql puts 0

Did anybody knows if it is possible to control this matter ?


Regards
Ezequias

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Round Numeric Type
@ 2006-10-31 21:18  Andrew Sullivan <ajs@crankycanuck.ca>
  parent: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Andrew Sullivan @ 2006-10-31 21:18 UTC (permalink / raw)
  To: pgsql-sql

On Tue, Oct 31, 2006 at 05:35:17PM -0200, Ezequias Rodrigues da Rocha wrote:
> Hi list,
> 
> I did a trigger to update a points on a table but in some cases the
> PostgreSQL does a round of my Numeric like.
> 
> If >= 0.5 so postgresql puts 1
> If < 0.5 so postgresql puts 0
> 
> Did anybody knows if it is possible to control this matter ?

Sounds like your datatype doesn't match your input, and that you've
got a type that rounds.  What's the datatype you're putting into?

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
Users never remark, "Wow, this software may be buggy and hard 
to use, but at least there is a lot of code underneath."
		--Damien Katz



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Round Numeric Type
@ 2006-11-01 12:06  Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  parent: Andrew Sullivan <ajs@crankycanuck.ca>
  0 siblings, 0 replies; 3+ messages in thread

From: Ezequias Rodrigues da Rocha @ 2006-11-01 12:06 UTC (permalink / raw)
  To: Andrew Sullivan <ajs@crankycanuck.ca>; +Cc: pgsql-sql

Numeric(9,2)

2006/10/31, Andrew Sullivan <ajs@crankycanuck.ca>:
>
> On Tue, Oct 31, 2006 at 05:35:17PM -0200, Ezequias Rodrigues da Rocha
> wrote:
> > Hi list,
> >
> > I did a trigger to update a points on a table but in some cases the
> > PostgreSQL does a round of my Numeric like.
> >
> > If >= 0.5 so postgresql puts 1
> > If < 0.5 so postgresql puts 0
> >
> > Did anybody knows if it is possible to control this matter ?
>
> Sounds like your datatype doesn't match your input, and that you've
> got a type that rounds.  What's the datatype you're putting into?
>
> A
>
> --
> Andrew Sullivan  | ajs@crankycanuck.ca
> Users never remark, "Wow, this software may be buggy and hard
> to use, but at least there is a lot of code underneath."
>                 --Damien Katz
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>



-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                                  Atenciosamente (Sincerely)
                        Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-11-01 12:06 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-10-31 19:35 Round Numeric Type Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
2006-10-31 21:18 ` Andrew Sullivan <ajs@crankycanuck.ca>
2006-11-01 12:06   ` Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox