Re: chop off non-meaningful digits

From: "Shoaib Mir" <shoaibmir(at)gmail(dot)com>
To: SunWuKung <Balazs(dot)Klein(at)t-online(dot)hu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: chop off non-meaningful digits
Date: 2006-11-13 13:53:00
Message-ID: bf54be870611130553u71dc72c4tb92ef64e85b12d06@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

ROUND function might help you there:

select round(1.2000::numeric, 1);

Regards,
--------
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 13 Nov 2006 05:45:44 -0800, SunWuKung <Balazs(dot)Klein(at)t-online(dot)hu> wrote:
>
> What would be the easiest way to get back only the meaningful digits of
> a numeric value in a pgsql function? eg?
>
> 1.002 --> 1.002
> 1.020 --> 1.02
> 1.200 --> 1.2
> 1.000 --> 1
>
> Thanks
> SWK
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2006-11-13 13:58:15 Re: chop off non-meaningful digits
Previous Message Raymond O'Donnell 2006-11-13 13:51:06 Re: chop off non-meaningful digits