proposal: numeric scale functions

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: proposal: numeric scale functions
Date: 2015-11-11 10:03:10
Message-ID: 5643125E.1030605@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

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.
These two functions are useful on their own, and when combined allow you
to look at the number of significant decimal places in a numeric.

Any thoughts, objections?

.m

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ants Aasma 2015-11-11 11:10:29 Re: Proposal: "Causal reads" mode for load balancing reads without stale data
Previous Message Thomas Munro 2015-11-11 09:22:11 Re: Proposal: "Causal reads" mode for load balancing reads without stale data