Re: Help w/ this lit'l function -Reply
Posted in 1996
Peter answered the question accurately, but if the real task is to return a character string of a money amount without a decimal or dollar sign (e.g. $ 123.45 is returned as "12345"), how about: UNCTION MoneyToString(MoneyAmt) DEFINE StringAmt CHAR(20), MoneyAmt Money(12,2) LET StringAmt = "00" IF MoneyAmt IS NOT NULL THEN LET StringAmt = (MoneyAmt * 100) USING "<<<<<<<<<<&&" end if RETURN StringAmt END FUNCTION This code is untried, and you might have to make the LET StringAmt a couple steps, but I assume you get the idea. Peter Tashkoff wrote: > > 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. //////////////// ======================================================= ////////// // Dennis J. Pimple Informix Software, Inc. ////// / /// Principal Consultant 5299 DTC Blvd Suite 740 ///// // //// dennisp@informix.com Englewood CO 80111 //// // ///// /// // ////// recept: 303-850-0210 // // /////// direct: 303-740-5611 Opinions expressed are mine, / /////////// fax: 303-843-6408 and do not necessarily //////////////// http://www.informix.com reflect those of my employer