Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Brad SanMarie
  Where is Brad SanMarie?
 
 California - United States
 Brad SanMarie
 To: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 Tags
Subject: RE: display numbers with leading 0's in grid
Thread ID: 289242 Message ID: 289312 # Views: 35 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Thursday, December 30, 2010 3:58:10 PM         
   


> >
> > Dear Gerrit,
> >
> > How about using an expression as the column's controlsource?
> >
> > For example:
> >
> > grid.column1.controlsource = " (RIGHT('0000' + ALLTRIM(STR(recordfield)), 4))"
> >
> > Brad Sanmarie
>
>
>
> There are special functions for the purpose of padding strings and numbers: PADL; PADR, PADC
>
PADL(number,length,'0')

> -Anders

Thanks, I've been twisting myself like a fretzel with my technique. Oh, well.

Brad Sanmarie

ENTIRE THREAD

display numbers with leading 0's in grid Posted by Gerrit Broekhuis @ 12/29/2010 9:49:11 PM
RE: display numbers with leading 0's in grid Posted by Koen Piller @ 12/29/2010 10:00:47 PM
RE: display numbers with leading 0's in grid Posted by Gerrit Broekhuis @ 12/30/2010 11:35:51 AM
RE: display numbers with leading 0's in grid Posted by Koen Piller @ 12/30/2010 3:00:07 PM
RE: display numbers with leading 0's in grid Posted by Brad SanMarie @ 12/29/2010 11:07:12 PM
RE: display numbers with leading 0's in grid Posted by Anders Altberg @ 12/30/2010 10:18:21 AM
RE: display numbers with leading 0's in grid Posted by Brad SanMarie @ 12/30/2010 3:58:10 PM
RE: display numbers with leading 0's in grid Posted by Tariq mehmood @ 12/30/2010 4:24:25 AM
RE: display numbers with leading 0's in grid Posted by Martin Krivka @ 12/30/2010 7:14:25 AM
RE: display numbers with leading 0's in grid Posted by Russell Hill @ 12/30/2010 8:47:26 AM