Ed Leafe wrote: > On Dec 24, 2007, at 11:16 AM, MB Software Solutions wrote: > > >> I've got a cursor that has numeric and character fields. The program >> inserts values into the numeric field, and the character fields >> DEFAULT >> value settings transform the numbers into their character equivalents. >> I had been using something like this: >> >> CREATE CURSOR curReport(nValue n(10,2), cValue c(10) DEFAULT >> ALLTRIM(STR(nValue,10,liDecimals))) >> >> ...where liDecimals is a value set at run time depending on the amount >> of decimal places I need for that record insert. In my testing I know >> that TRANSFORM would be great like this: >> >> TRANSFORM(nValue,'999,999.99') >> >> ...but sometimes I don't want the character representation to have the >> same number of decimal positions. My plan B is to create some rigged >> UDF whereby I pass the value and the number of decimals places I want >> and it parses/builds it for me, but that seems kludgey. Is there a >> way >> to get the transform to behave variably like I had in my initial >> DEFAULT >> value with ALLTRIM(STR(..)) without a UDF ?? >> > > Could you just do: > > TRANSFORM(ROUND(nValue, liDecimals)) > >
Actually, that doesn't work....I need the commas to separate thousands. -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com "Work smarter, not harder, with MBSS custom software solutions!" _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

