Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Format mask to hide decimals
Message
From
20/04/2010 13:30:26
 
 
To
20/04/2010 13:22:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01460944
Message ID:
01461158
Views:
47
That's the way I also usually handle these kind of problems.

>Tore and all, thanks for the help. I decided to change the field to char, and format the data when creating/updating the cursor as I could not get the dynamic input mask to work. Thanks.
>
>
>>Is the cursor the result of a SQL select statement?
>>
>>Select *,Cast(Iif(yourfield%1#0,yourfield,Int(yourfield))as c(10)) as showvalue ...
>>
>>>No, that didnt do the trick either. I dont think the refresh event will be called for each cell ...
>>>
>>>The control source is a cursor.
>>>
>>>
>>>>Try this: ColumnX.refresh:
>>>>
this.value=iif(yourfield%1#0,transform(yourfield,'999.999'),transform(yourfield,'999.999.99')
>>>>Is the controlsource a cursor or a table?
>>>>
>>>>
>>>>>Yes
>>>>>
>>>>>>Hi Jos,
>>>>>>
>>>>>>is the column read only?
>>>>>>
>>>>>>>Hi Tore,
>>>>>>>
>>>>>>>I am trying to get this to work. I have the following set in the properties window DynamicInputMask for the column:
>>>>>>>
>>>>>>>
>>>>>>>" IIF(myField%1=0),'999,999','999,999.99' "
>>>>>>>
>>>>>>>
>>>>>>>But it does not seem to have any effect. What am I missing?
>>>>>>>
>>>>>>>Thanks
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>No, but you can probably the column's DynamicInputMask property, something like
>>>>>>>>thisform.Grid1.Column3.DynamicInputMask = "IIF(yourfield%1#0),'999,999','999,999.99"
>>>>>>>>
>>>>>>>>>Hi All,
>>>>>>>>>
>>>>>>>>>Is there a format mask I can use in a grid that will hide the decimal portion of numerics if they are all zero?
>>>>>>>>>
>>>>>>>>>Thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform