Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decimal Problem in Report Calculation

Status
Not open for further replies.

jackstrawn

Programmer
Joined
Aug 9, 2001
Messages
43
Location
US
Using VFP 7.0, SP1 and this is the first time I've encountered the following problem:

Decimals are set to 2 (Set Decimals to 2)

Calculation in Command Window returns 2 decimals; in a report detail band (I've used a million times) now returns 4 decimal places.

(Field1/Field2)*100

TIA,

Jack Strawn
 
I should add to my original post that I could use the ROUND() function to resolve the problem. Just don't understand why I can't control number of decinals in reports with Set Decimal.
 
Jack,
SET DECIMALS is only one of many settings that is data session dependent. If you are calling this report from a form that uses a Private datasession, then you'll need to set it again here. See the HELP topic "SET DATASESSION Command" for a list of all those that get reset to default values. One technique that is often used is to add a check in your Form baseclass to reset these vales to the settings you prefer for Private Datasessions, so that you can make any changes you need to in just one place.

Rick
 
rgbean-

Thanks much. Thought I had read everything!

Jack Strawn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top