>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 >>
>lcIm = '99999999' >lcIm = Stuff(lcIm, Len(lcIm)-Thisform.decPlaces, 1, '.') >>But this falls down on 0 dp
******************************************************************** * Description.......: SetReplaceValAttr * Calling Samples...: thisform.SetReplaceValAttr(alltrim(this.value)) * Parameter List....: lcField * Created by........: Nadya Nosonovsky 06/23/2000 03:46:22 PM * Modified by.......: Nadya Nosonovsky 06/27/2000 05:05:42 PM ******************************************************************** lparameters tcField local lcType, lnSize, lnElement, lnFound, lnDigits with thisform lnFound=ascan(.abldmflds, m.tcField) && Search for this field lnElement=asubscript(.abldmflds, m.lnFound,1) .cFieldType=.abldmflds[m.lnElement, 2] && The type of the field lcType = .cFieldType lnSize= .abldmflds[m.lnElement, 3] && Field size lnDigits= .abldmflds[m.lnElement, 4] && Decimal places if .globOPt.value=1 && Replace with constant with .ReplaceVal .format='' .inputmask='' do case case m.lcType = "C" .value = "" .format='R' .inputmask=replicate('X', m.lnSize) case m.lcType $ "NFIY" .value = 0 if m.lcType='Y' && currency .format='$' endif if m.lcType='N' if m.lnDigits>0 .inputmask=replicate('9',m.lnSize-m.lnDigits-1)+'.'+replicate('9',m.lnDigits) else .inputmask=replicate('9',m.lnSize) endif endif case m.lcType = "D" && Date .value = {} .format='YL' case m.lcType = "T" && Datetime .value = ctot('') .format='YL' case m.lcType = "L" .value = .f. case m.lcType='M' && Memo .value = "" endcase endwith endif endwith