Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: onytoo
  Where is onytoo?
 Padang
 Indonesia
 onytoo
 To: Tariq Mehmood
  Where is Tariq Mehmood?
 BAHAWALPUR
 Pakistan
 Tariq Mehmood
 Tags
Subject: RE: Numeric Format in Grid
Thread ID: 311216 Message ID: 311238 # Views: 51 # Ratings: 2
Version: Visual FoxPro 9 Category: Grids
Date: Wednesday, June 29, 2011 9:30:04 PM         
   


> >
> >
> > This is simple solution using DynamicInputMask:
> >
> >
> > thisform.Grid1.Column1.DynamicInputMask = ;
> >   [IIF((ctable.num%1)>0,] + ;
> >   ['9,999.'+REPLICATE('9',LEN(LTRIM(RTRIM(STR((ctable.num%1)*1000),0,'0')))),'9,999')]
> > 
> > *!* OR
> > 
> > thisform.Grid1.Column1.DynamicInputMask = ;
> >   [IIF((ctable.num%1)>0,] + ;
> >   ['9,999.'+REPLICATE('9',LEN(LTRIM(RTRIM(STR((ctable.num%1),8,3),0,'0')))-2),'9,999')]
> > 
> > 

> >
> >
> > If your grid is editable then:
> >
> >
> > *!* Grid1.Column1.Text1.GotFocus
> > this.InputMask = [9,999.999]
> > 

> >
> >
> > Regards,
> > Onytoo
>
> Thanks Sir,
>
> Following procedure works fine for me
>
>
> thisform.Grid1.Column3.DynamicInputMask = ;
>   [IIF((closing.open_qty%1)>0,] + ;
>   ['9,999.'+REPLICATE('9',LEN(LTRIM(RTRIM(STR((closing.open_qty%1),8,3),0,'0')))-2),'9,999')]
> 

>
> But.......
>
> How to hide 0, zero value?


thisform.Grid1.Column3.DynamicInputMask = ;
  [IIF((closing.open_qty%1)>0,] + ;
  ['@Z 9,999.'+REPLICATE('9',LEN(LTRIM(RTRIM(STR((closing.open_qty%1),8,3),0,'0')))-2),'@Z 9,999')]



Regards,
Onytoo

ENTIRE THREAD

Numeric Format in Grid Posted by Tariq mehmood @ 6/29/2011 7:02:12 PM
RE: Numeric Format in Grid Posted by Borislav Borissov @ 6/29/2011 7:13:37 PM
RE: Numeric Format in Grid Posted by onytoo @ 6/29/2011 8:11:30 PM
RE: Numeric Format in Grid Posted by Tariq mehmood @ 6/29/2011 9:01:43 PM
RE: Numeric Format in Grid Posted by onytoo @ 6/29/2011 9:30:04 PM
RE: Numeric Format in Grid Posted by Tariq mehmood @ 6/30/2011 5:36:49 AM
RE: Numeric Format in Grid Posted by Jun Tangunan @ 6/30/2011 6:16:12 AM
RE: Numeric Format in Grid Posted by Tariq mehmood @ 6/30/2011 6:19:23 AM
RE: Numeric Format in Grid Posted by Jun Tangunan @ 6/30/2011 6:28:36 AM
RE: Numeric Format in Grid Posted by Manoj Patel @ 6/30/2011 7:49:14 AM
RE: Numeric Format in Grid Posted by onytoo @ 6/30/2011 8:26:33 AM
RE: Numeric Format in Grid Posted by Tariq mehmood @ 6/30/2011 1:56:25 PM
RE: Numeric Format in Grid Posted by onytoo @ 6/30/2011 5:01:06 PM
RE: Numeric Format in Grid Posted by Tariq mehmood @ 6/30/2011 7:36:17 PM
RE: Numeric Format in Grid Posted by onytoo @ 6/30/2011 11:38:27 PM