Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to extract length,decimal of a numeric field
Message
From
11/03/2000 03:33:43
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00344461
Message ID:
00344552
Views:
16
>>Assuming I know the name of a field and if it is numeric or not. With those two values, what would be the best way to extract the length and the decimal value of that field from the field structure?
>
>You can extract the length using FSIZE().
>
>How about this small function to get the decimal?
>
>LPARAMETER tcFldName
>LOCAL lcStr
>lcStr = ALLT(PADL(&tcFldName,100))
>RETURN IIF(AT(".",lcStr) > 0,LEN(RIGHT(lcStr,LEN(lcStr) - AT(".",lcStr))),0)

This is what I was looking for.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform