Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to store 3 zeros in a numeric field?
Message
From
21/11/2002 22:53:44
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
21/11/2002 22:46:52
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00725567
Message ID:
00725606
Views:
18
>>Display transform(Field, "@L 999") instead. It will give you leading zeros. But this also means you'll get 001 for 1, 020 for 20 etc. If you need it for zeros only, then transform(Field, iif(field=0, "@L ","")+"999").
>
>Hi Dragan:
>
>Thank you for your kind reponse.
>
>This is a neat idea too. What I have done for now is that I used an If statement to check if the field had a zero. If it did, I then redeclared the variable that holeds that information as a String and then assigned it a value of "000". I will try yoour idea in a report.

Switching the type of a variable may be tricky, and could generally make you write more code, and yet the code would be less stable.

My advice is to keep it numeric, and just do this sort of makeup for display purposes. If you're keeping it in a textbox, set the texbox's .format="L", .inputmask="999". You may want to remove the format when it gets focus and restore it when it loses focus, to ease the data input.

back to same old

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

Click here to load this message in the networking platform