Re: Random Number SKU Generator

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Random Number SKU Generator
Date: 2015-02-15 09:22:58
Message-ID: 1423992178006-5838022.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Peter Dabrowski wrote
> I found one issue,
> The leading zeros are removed. expected number "00042" printed "42"

My unscientific suggestion is to combine a leading random number between 1
and 9 with the trailing 4 digit (With leading zeros) number so that you
never have the first digit of the SKU be a zero.

Too many technical issues with all numeric strings containing leading zeros;
and I think human ones too.

David J.

--
View this message in context: http://postgresql.nabble.com/Random-Number-SKU-Generator-tp5837824p5838022.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message David G Johnston 2015-02-15 09:35:28 Re: Random Number SKU Generator
Previous Message Peter Dabrowski 2015-02-15 03:22:55 Re: Random Number SKU Generator