Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3iYm-0005KA-BU for pgsql-sql@arkaria.postgresql.org; Sun, 24 Jan 2021 16:48:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l3iYl-0006BQ-36 for pgsql-sql@arkaria.postgresql.org; Sun, 24 Jan 2021 16:48:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3iYk-0006BJ-Sl for pgsql-sql@lists.postgresql.org; Sun, 24 Jan 2021 16:48:18 +0000 Received: from fw01.panaccess.com ([95.157.62.130] helo=fw02.panaccess.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3iYe-0001I6-06 for pgsql-sql@lists.postgresql.org; Sun, 24 Jan 2021 16:48:17 +0000 Received: from Galaxy-Note10.fritz.box (ipbcc2ec64.dynamic.kabel-deutschland.de [188.194.236.100]) by fw02.panaccess.com (panaccess mail services) with ESMTPSA id 2A597200B6549; Sun, 24 Jan 2021 11:48:08 -0500 (EST) Date: Sun, 24 Jan 2021 17:48:11 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----778LK8ROR81X26ZRUAERTPFQGZQVH7" Content-Transfer-Encoding: 7bit Subject: Re: format integer To: ml@ft-c.de,pgsql-sql@lists.postgresql.org From: Torge Kummerow Message-ID: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------778LK8ROR81X26ZRUAERTPFQGZQVH7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Well strange requirement=2E Guess you could do it with=20 case when x < 10 then =2E=2E=2E else when x < 100 then =2E=2E=2E=2E=20 Don't think you'll find anything native=2E Am 24=2E Januar 2021 15:57:02 MEZ schrieb ml@ft-c=2Ede: >Hello,=20 > >I need a integer format with different decimal places=20 >The integer should have 6 diggits=2E (or 7 or 8) > >Example (6-diggits) >input -> output >123456=2E789 -> 123456 =20 >1234=2E56789 -> 1234=2E56 >12=2E3456789 -> 12=2E3456 > >but when it is more then 10^6 then=20 >12345678=2E9 -> 12345678=C2=A0 >=20 >Is there a pg function for this task? > >Franz=20 --=20 Diese Nachricht wurde von meinem Android-Ger=C3=A4t mit K-9 Mail gesendet= =2E ------778LK8ROR81X26ZRUAERTPFQGZQVH7 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Well strange requirement=2E

Guess you could= do it with
case when x < 10 then =2E=2E=2E else when x < 100 the= n =2E=2E=2E=2E

Don't think you'll find anything native=2E

Am 24=2E Januar 2021 15:57:02 MEZ schrieb ml@ft-c= =2Ede:
Hello, 

I need a integer format with differen= t decimal places
The integer should have 6 diggits=2E (or 7 or 8)
Example (6-diggits)
input -> output
123456=2E789 -> 12= 3456
1234=2E56789 -> 1234=2E56
12=2E3456789 -> 12=2E3= 456

but when it is more then 10^6 then
12345678=2E9 -> 12345= 678 

Is there a pg function for this task?

Franz





--
Diese Nachricht wurde= von meinem Android-Ger=C3=A4t mit K-9 Mail gesendet=2E ------778LK8ROR81X26ZRUAERTPFQGZQVH7--