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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help me on a Roundation problem ???

Status
Not open for further replies.

sarah77

Programmer
Jun 4, 2002
36
0
0
US
In my program I need to calculate the vacation balance.
Within a process there is a field resulted of:

Vac_Balance = (22/12/30)*27

The result should be 1.649 , but it gives me 1.650 ???

When I divided (22/12/30) separtely it gives me (0.06111111111) and then by multiply :
(0.06111111111)*27 it gives me the required answer=1.649

Any solution for that will be much appriciated.

Note: I'm using vfp5
 
Try this:

set deci to 4
? round((22/12/30),4)*27

I get 1.6497
 
Thanks Wawalter its really helped me eventhough I used with 15 decimal as :

? round((22/12/30),15)*27

Thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top