Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Looking for a snazzy way
Message
 
 
To
25/07/2001 05:29:18
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00534851
Message ID:
00535113
Views:
16
local lnDec
lnDec = set('decimals')
set decimals to (ThisForm.decPlaces)
This.InputMask = transform(99999999/10**(-ThisForm.decPlaces))
set decimals to (lnDec)

>Hi All,
>
>I'm looking for a neat way to do the following case statement.. it's to set a input mask depending on decimal places
>
>
>Do Case
>Case Thisform.decPlaces = 0
>	lcIm = '99999999'
>Case Thisform.decPlaces = 1
>	lcIm = '999999.9'
>Case Thisform.decPlaces = 2
>	lcIm = '99999.99'
>Otherwise
>	lcIm = '99999999'
>EndCase
>
>
>The closest I have got is this
>
>lcIm = '99999999'
>lcIm = Stuff(lcIm, Len(lcIm)-Thisform.decPlaces, 1, '.')
>
>But this falls down on 0 dp
>
>Anyone got any ideas?
>
>TIA
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform