RE: VFP Rounding

Author: Richard Kaye

Posted: 2010-05-04 at 18:32:02

And as someone else mentioned you do need to set decimals to some number greater than the precision you want to preserve if you don't want the transform to do an implicit round. The PADx functions also do an implicit transform if you want a fixed string length but then you will get full precision.

rk

-----Original Message-----

From: profoxtech-bounces@leafe.com [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye

Sent: Tuesday, May 04, 2010 6:15 PM

To: profoxtech@leafe.com

Subject: RE: VFP Rounding

Use TRANSFORM with a picture clause if you're not interested in the extra precision. Otherwise use ROUND.

m.v1=100.1234

m.v2=100.1234

m.v3=100.1234

m.v4=100.1234

m.nresult=m.v1+m.v2+m.v3+m.v4

m.cresult=transform(m.nresult, '@R 999,999,999.99')

WAIT WINDOW m.nresult

WAIT WINDOW m.cresult

rk

_______________________________________________

Post Messages to: ProFox@leafe.com

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/DF1EEF11E586A64FB54A97F22A8BD0440682815CEB@ACKBWDDQH1.artfact.local

** 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.

©2010 Richard Kaye