I am using vfp8 and winxp.

I have a grid column with recordsource a numeric field with width 5 and
decimal 2 in a table.

The value is calculated, never entered manually.

When the value is 12.25 I want 12.25 displayed, but when the value is 12.00
I want 12 displayed. That is, I want only the integer value to show when
there are no decimals.

What is the easy way to do this?

Regards,

Jan Nordgreen

Re: How to display integer value when there is no decimal part? by Mark

Mark
Tue Mar 02 09:22:34 CST 2004

Add a second textbos to that column so you have 2 textbox controls in that
column named Text1 and Text2. For the InputMask put 99.99 for Text1 and 99
for Text2. In the DynamicCurrentControl of that column put
iif(TableAlias.FieldName - INT(TableAlias.FieldName) = 0, 'Text2', 'Text1')

Then set the Column Sparse property to False. You will probably need to
change some of the Text1 and Text2 properties to get these controls to look
right.

"Jan Nordgreen" <room23111@hotmail.con> wrote in message
news:eWzUz6FAEHA.1032@TK2MSFTNGP10.phx.gbl...
> I am using vfp8 and winxp.
>
> I have a grid column with recordsource a numeric field with width 5 and
> decimal 2 in a table.
>
> The value is calculated, never entered manually.
>
> When the value is 12.25 I want 12.25 displayed, but when the value is
12.00
> I want 12 displayed. That is, I want only the integer value to show when
> there are no decimals.
>
> What is the easy way to do this?
>
> Regards,
>
> Jan Nordgreen
>
>
>



Re: How to display integer value when there is no decimal part? by Thierry

Thierry
Tue Mar 02 09:43:39 CST 2004

transform() automatically strips off unecessary decimal point and =
figures.

You may try
column.controlSource =3D 'transform(field)'
--=20
Th N
Abaque

"Mark McCasland" <mmccaslaATairmailDOTnet> a =E9crit dans le message de =
news:OEhtxpGAEHA.2316@TK2MSFTNGP10.phx.gbl...
> Add a second textbos to that column so you have 2 textbox controls in =
that
> column named Text1 and Text2. For the InputMask put 99.99 for Text1 =
and 99
> for Text2. In the DynamicCurrentControl of that column put
> iif(TableAlias.FieldName - INT(TableAlias.FieldName) =3D 0, 'Text2', =
'Text1')
>=20
> Then set the Column Sparse property to False. You will probably need =
to
> change some of the Text1 and Text2 properties to get these controls to =
look
> right.
>=20
> "Jan Nordgreen" <room23111@hotmail.con> wrote in message
> news:eWzUz6FAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > I am using vfp8 and winxp.
> >
> > I have a grid column with recordsource a numeric field with width 5 =
and
> > decimal 2 in a table.
> >
> > The value is calculated, never entered manually.
> >
> > When the value is 12.25 I want 12.25 displayed, but when the value =
is
> 12.00
> > I want 12 displayed. That is, I want only the integer value to show =
when
> > there are no decimals.
> >
> > What is the easy way to do this?
> >
> > Regards,
> >
> > Jan Nordgreen
> >
> >
> >
>=20
>

Re: How to display integer value when there is no decimal part? by Gregory

Gregory
Tue Mar 02 09:42:35 CST 2004

Jan,

You can use the DynamicInputMask of the column eg

this.Columns(1).DynamicInputMask=[iif(empty(mod(] +
this.Columns(1).ControlSource + [,1)), '###,###', '####.##')]


Gregory
_____________
"Jan Nordgreen" <room23111@hotmail.con> wrote in message
news:eWzUz6FAEHA.1032@TK2MSFTNGP10.phx.gbl...
> I am using vfp8 and winxp.
>
> I have a grid column with recordsource a numeric field with width 5 and
> decimal 2 in a table.
>
> The value is calculated, never entered manually.
>
> When the value is 12.25 I want 12.25 displayed, but when the value is
12.00
> I want 12 displayed. That is, I want only the integer value to show when
> there are no decimals.
>
> What is the easy way to do this?
>
> Regards,
>
> Jan Nordgreen
>
>
>


Re: How to display integer value when there is no decimal part? by Mark

Mark
Tue Mar 02 09:56:49 CST 2004

Works beautifully as long as you have no InputMask

"Thierry Nivelet" <info_nospam@abaqueinside.com> wrote in message
news:%239O6k0GAEHA.1956@TK2MSFTNGP10.phx.gbl...
transform() automatically strips off unecessary decimal point and figures.

You may try
column.controlSource = 'transform(field)'
--
Th N
Abaque

"Mark McCasland" <mmccaslaATairmailDOTnet> a écrit dans le message de
news:OEhtxpGAEHA.2316@TK2MSFTNGP10.phx.gbl...
> Add a second textbos to that column so you have 2 textbox controls in that
> column named Text1 and Text2. For the InputMask put 99.99 for Text1 and 99
> for Text2. In the DynamicCurrentControl of that column put
> iif(TableAlias.FieldName - INT(TableAlias.FieldName) = 0, 'Text2',
'Text1')
>
> Then set the Column Sparse property to False. You will probably need to
> change some of the Text1 and Text2 properties to get these controls to
look
> right.
>
> "Jan Nordgreen" <room23111@hotmail.con> wrote in message
> news:eWzUz6FAEHA.1032@TK2MSFTNGP10.phx.gbl...
> > I am using vfp8 and winxp.
> >
> > I have a grid column with recordsource a numeric field with width 5 and
> > decimal 2 in a table.
> >
> > The value is calculated, never entered manually.
> >
> > When the value is 12.25 I want 12.25 displayed, but when the value is
> 12.00
> > I want 12 displayed. That is, I want only the integer value to show when
> > there are no decimals.
> >
> > What is the easy way to do this?
> >
> > Regards,
> >
> > Jan Nordgreen
> >
> >
> >
>
>