Hi. Is there a way with to_char to suppress a decimal point, like a
leading or trailing 0, so that integers will not have them, but non-ints
will? I'm hoping I'm missing something easy. Thanks.
Ken
SELECT val,to_char(val::decimal(6,2),'FM999,999D99') FROM
( SELECT 1 AS val UNION SELECT 1.05 AS val) foo;
val | to_char
------+---------
1 | 1.
1.05 | 1.05
--
AGENCY Software
A Free Software data system
By and for non-profits
*http://agency-software.org/ <http://agency-software.org/>*
*https://agency-software.org/demo/client
<https://agency-software.org/demo/client>*
[email protected]
(253) 245-3801
Subscribe to the mailing list
<[email protected]?body=subscribe> to
learn more about AGENCY or
follow the discussion.