Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trim trailing zeroes from number in form field
Message
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01508560
Message ID:
01508561
Views:
62
>I have to be missing something simple here, I hope.
>
>I have a form field that is using a numeric field type. It may be 60, 60.5, or 60.05, with anything from an integer to two decimal places. If the number is 60.00, it needs to show simply 60, etc. In other words, remove trailing zeroes. Setting decimal places and formats seem to only account for a fixed number of decimal places - I would like that to display based upon whether the extra decimal places are needed. I've checked inputmask and format properties but don't see something that will do this easily.
>
>Is there a way to only show what's needed but allow input for decimal places?
>
>Thanks

I don't think it's a simple problem. You can use a transparent label and show label with something like padr(this.value, 10) when you LostFocus out of the field.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform