SET DECIMALS TO 6 clear x=9999999999.9 xInteger=9999999999 xFraction=0.9 Zero = 0 * ? , CAST and PADX() use the variable decimal for do the string conversion ? CAST(x AS v(20)) ? CAST(xInteger AS V(20)) ? CAST(xFraction AS V(20)) ? ? "when VFP compute a SUM expression, the rule is not immediate" ? "DEFINE VFPDECIMALS(exp_MemberList)" ? " retDecimals=0" ? " FOR EACH exp IN exp_MemberList" ? " retDecimals=ICASE(;" ? " , exp is a literal numeric or a variable" && Atom ? " , MAX(retDecimals,DECIMALS(exp))" ? " , exp is a full literal exp" && Not Atom ? " , MAX(retDecimals,DECIMALS(exp),VFPDECIMALS(GETMEMBERS(exp)))" ? " ," && not Atom ? " MAX(retDecimals,VFPDECIMALS(GETMEMBERS(exp)))" ? " )" ? " ENDFOR" ? " RETURN retDecimals" ? "EXAMPLES" ? "1=VFPDECIMALS([m.x],[9999999999])" at 5 ? m.x - 9999999999 ? "1=VFPDECIMALS([m.x],[9999999999.0])" at 5 ? m.x- 9999999999.0 ? "1=VFPDECIMALS([m.x],[(xInteger)])" at 5 ? m.x-(xInteger) ? "1=VFPDECIMALS([m.x],[xInteger])" at 5 ? m.x- xInteger ? "6=VFPDECIMALS([9999999999],[9999999999])" at 5 ? 9999999999 - 9999999999 && this is equal to (9999999999 - 9999999999) ? "6=VFPDECIMALS([9999999999.9],[(9999999999)])" at 5 ? 9999999999.9-(9999999999) ? "6=VFPDECIMALS([m.x],[(9999999999)])" at 5 ? m.x-(9999999999) ? "6=VFPDECIMALS([m.x],[(0+9999999999)])" at 5 && this cut the rule ? m.x-(0+9999999999) ? "1=VFPDECIMALS([m.x],[(m.zero+9999999999)])" at 5 && this cut the cut rule ? m.x-(m.zero+9999999999)Someone can call this By design, but it is a crazy design,