Post Reply 
Bug or Not? Taking STRING of a string whilst making leading zeros
01-30-2018, 07:58 PM (This post was last modified: 01-30-2018 08:00 PM by StephenG1CMZ.)
Post: #8
RE: Bug or Not? Taking STRING of a string whilst making leading zeros
Thanks for those tips - I was assuming STRING was cleverly turning whatever into a string and could leave "9" unchanged.
So far I have this for producing leading zeros (based on the above but handling 0 zeros):
Code:


 EXPORT NZEROS(NZ)
 //ONLY WORKS FOR NZ<12
 BEGIN
  RETURN IFTE(NZ>0,MID(STRING(10^NZ),2),"");
 END;
It only works with less than 12 zeros...
I am surprised there is no built-in for this.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Bug or Not? Taking STRING of a string whilst making leading zeros - StephenG1CMZ - 01-30-2018 07:58 PM



User(s) browsing this thread: 1 Guest(s)