Re: format integer

From: Torge Kummerow <tk(at)panaccess(dot)com>
To: ml(at)ft-c(dot)de,pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: format integer
Date: 2021-01-24 16:48:11
Message-ID: FA8645D1-50B6-4A96-8D94-BBDF4A6BAAD1@panaccess.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Well strange requirement.

Guess you could do it with
case when x < 10 then ... else when x < 100 then ....

Don't think you'll find anything native.

Am 24. Januar 2021 15:57:02 MEZ schrieb ml(at)ft-c(dot)de:
>Hello,
>
>I need a integer format with different decimal places
>The integer should have 6 diggits. (or 7 or 8)
>
>Example (6-diggits)
>input -> output
>123456.789 -> 123456
>1234.56789 -> 1234.56
>12.3456789 -> 12.3456
>
>but when it is more then 10^6 then
>12345678.9 -> 12345678 
>
>Is there a pg function for this task?
>
>Franz

--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message ml 2021-01-24 17:35:15 Re: format integer
Previous Message Steve Midgley 2021-01-24 16:37:43 Re: format integer