Re: proposal: numeric scale functions

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Marko Tiikkaja <marko(at)joh(dot)to>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: numeric scale functions
Date: 2015-11-11 13:53:58
Message-ID: 56434876.8070307@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/11/15 5:03 AM, Marko Tiikkaja wrote:
> Dealing with "numeric"s right now in cases where it's really important
> that the scale is correct is quite painful. For example, if I want to
> accept a EUR amount as an input, I often want to reject values such as
> '21.413', but I'd be fine with e.g. '21.410000'. My suggestion is to
> add two functions: one to return the number of decimal places in a
> numeric, and another one to remove non-significant decimal places.

I can see both of these being useful, but the terminology is not
correct. The trailing zeroes are "significant". Maybe the function
could be called "trim", in analogy to trimming whitespace off strings.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-11-11 14:01:25 Re: proposal: multiple psql option -c
Previous Message Craig Ringer 2015-11-11 13:07:46 Re: can we add SKIP LOCKED to UPDATE?