Hi,
I'm writing a Postgres native extension and I would like to check that a
numeric is zero.
My problem is that all exported methods like numeric_eq or numeric_sign
require me to have a numeric to start with, and const_zero is not exported
in numeric.c.
Any idea how to check it?
Thanks
Gabriel
Hi Ken,
Thanks a lot, that's a cool idea and I think that it will cover my needs.
On Thu, 20 Sep 2018 at 02:04, Ken Tanzer wrote:
> On Wed, Sep 19, 2018 at 6:34 AM Gabriel Furstenheim Milerud <
> furstenh...@gmail.com> wrote:
>
> Maybe that is not possible with numbers?
aver
wrote:
> On 9/19/18 6:11 AM, Gabriel Furstenheim Milerud wrote:
> > I'm not completely sure that that actually works
> >
> > SELECT to_number('9,134','9V3') =9
>
> SELECT (to_number('9,134', '9')/1000)::numeric(4,3);
> numeric
> -
> 9.13
, 19 Sep 2018 at 14:57, Adrian Klaver
wrote:
> On 9/19/18 5:38 AM, Gabriel Furstenheim Milerud wrote:
> > Hello,
> > I'd like to convert a string number to a number being able to provide
> > the custom format.
> > With dates it works perfectly fine, so that I can do:
>
Hello,
I'd like to convert a string number to a number being able to provide the
custom format.
With dates it works perfectly fine, so that I can do:
SELECT to_date('18 09 10', 'YY MM DD')
Is there something similar with numbers?
SELECT to_number('9,000', some_format) = 9;
SELECT