Skip site navigation (1) Skip section navigation (2)

padding an integer ...

From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: padding an integer ...
Date: 2005-10-26 03:57:25
Message-ID: 20051026005530.E993@ganymede.hub.org (view raw or flat)
Thread:
Lists: pgsql-sql
Is there any way of "padding" an integer, similar to how, in perl, I would 
do:

printf("%03d", 1);

to get:

001

Specifically, I'm looking to do this in a pl/pgsql function ... like to 
avoid moving to pl/php or pl/perl if I can ... but, from what I've been 
able to find, I suspect I'm not going to have much of a choice ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy(at)hub(dot)org           Yahoo!: yscrappy              ICQ: 7615664

Responses

pgsql-sql by date

Next:From: Marc G. FournierDate: 2005-10-26 03:58:13
Subject: pl/* overhead ...
Previous:From: Tom LaneDate: 2005-10-26 03:53:44
Subject: Re: broken join optimization? (8.0)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group