Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format Number 1

Status
Not open for further replies.

angjbsca

Programmer
May 26, 2006
30
PR
Hi How I can format a field with this value '6' to '06' in
as400 db2...

in .net would look like this format(field,'0#')


 
I don't know about AS400 specifics, but you could try:

digits(dec(FIELD,2))

You will have to investigate overflow possibilities etc
 
Brian,

I always did this with the following trick:
substr(field+100,2)

I like your approach much better. I've just always feared the digits function.

- Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top