Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Format Numeric values
Message
From
10/01/1999 08:21:22
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00174133
Message ID:
00174474
Views:
29
>The way I have it is for the to type in there but that could very easily changed if it bacame necessary to achieve the goal.
>
>>>I have noticed that the old @say pict "999" formats numerical data in a way hard to achieve any other way.
>>>
>>>For example @0,0 say 9999.99 PICT "999.999.999,99" spits 9.999,99
>>>For those who may wonder why this would be necessary if you wanted to format an amount of money in most European countries where they use a a comma (,) as a decimal separater and a period as a thousand separator. So $100,000.00 might be something like 200.000,00DM.
>>>
>>>I would want to be able to capture the @say output into a variable that would be more useful than just saying to the screen or file.
>>>

I am using Set Point to "," and Set Separator to "." all the time (Europe here), but there are more issues to that. First, even if you may apply these two SETs in the YourGrid.ColumnX.Text1.GotFocus and revert it in its .LostFocus, it won't do you no good, because it also needs a keyboard driver which has a decimal comma instead of period for the numeric keypad. You may have to play with language IDs and swap keyboard drivers (there's a neat article by Vladimir Shevchenko - btw, where's he, haven't seen anything from him in months here - it was published in VFUG this fall), making sure the european keyboard driver was installed in the first place, which is just a plain overhead - you don't need that.

You may have two controls for this field - the standard Text1 which would be formatted as needed, with proper currency denoted, and another textbox which would show just standard number and be actually used for input. Now this second one should be set as DynamicControl, and Sparse should be set to .f. (I think). Now the only trick is to find a way to format the Text1 properly for each individual record (with proper currency settings - left, right, currency mark, decimal point/comma and other). The other control should default to standard format of entering numbers on that machine.

This sounds a bit confusing (I'm not quite clear on the details myself), but I think the solution would go along these lines.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform