Help w/ this lit'l function -Reply
Posted in 1996
Use clipped in the second assignment eg LET StringAmt = DolarAmt clipped, CentsAmt rgds Peter Tash >>> Hannah Sobie Fiabema <hfiabema@osf1.gmu.edu> 16/October/1996 05:50am >>> Gurus, I am having a little proble w/ this function. It is SUPPOSED to accept an argument of type Money, and return the ascii equivalent minus the dollar sign and decimal point. Everything almost works except it is NOT returning the Cents portion of the argument. Thanks for any and all help. Here is the code: FUNCTION MoneyToString(MoneyAmt) DEFINE StringAmt CHAR(20), DolarAmt CHAR(20), CentsAmt CHAR(20), cMoneyAmt CHAR(20), MoneyAmt Money(12,2), StrLen integer initialize dolaramt, centsamt to null IF MoneyAmt IS NOT NULL THEN LET cMoneyAmt = MoneyAmt LET cMoneyAmt = cMoneyAmt clipped LET StrLen = LENGTH(cMoneyAmt) LET DolarAmt = cMoneyAmt[2,(StrLen-3)] display "dolaramt...",dolaramt LET CentsAmt = cMoneyAmt[(StrLen-2),StrLen] display "centsamt...",centsamt sleep 2 LET StringAmt = DolarAmt clipped IF CentsAmt IS NULL THEN display "NULL yes..." LET StringAmt = DolarAmt, "00" ELSE LET StringAmt = DolarAmt, CentsAmt END IF --LET StringAmt = StringAmt clipped display "stringamt...",stringamt sleep 2 end if RETURN StringAmt END FUNCTION