Search Postgresql Archives

Re: numeric data type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Juan Pablo L. wrote:
> thank you for your answer, the function is declared as:
> 
> FUNCTION wtt_discount_account(IN in_phonenumber varchar(20),IN in_balanceid integer,IN in_chgval numeric(10,2))
> 
> i chose numeric because is supposed to be better for numbers/money operations, supposed to be exact,
> i would not want to loose precision because that is money, is there any other way which does not 
> involve loosing precision ? thankS!!

What you need is to use PG_GETARG_NUMERIC, then, and use a Numeric *
variable rather than float8.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux