>Hi Chuck.
>
>>Is there a function that will return how many decimal places a numberic field has?
>
>If the table is open, you could use something like (where FIELDNAME is the name of the field):
lcValue = transform(FIELDNAME)
>lnPlace = at('.', lcValue)
>lnLen = len((lcValue)
>lnDecimals = iif(lnPlace = 0, 0, lnLen - lnPlace)
This is actually more code than using Mark's suggestion of AFIELDS, which can be reduced to the admittedly dense {g}:
afields(laFields)
>lnDecimals = laFields[ascan(laFields, 'FIELDNAME', -1, -1, 1, 15), 4]
Doug
The transform function doesn't work if the value in the field is 2.000 transform will just return the "2" I ended up doing something like Alan Popow suggested.
LEN(TRIM(PADR(MOD(field, 1), 21))) - 2
Charles
"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers