Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ilya Rabyy
  Where is Ilya Rabyy?
 Fountain Valley
 California - United States
 Ilya Rabyy
 To: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 Tags
Subject: RE: Rounding an AVG for totals - HOW TO?
Thread ID: 188962 Message ID: 189012 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Reports and Printers
Date: Wednesday, August 13, 2008 5:02:30 PM         
   


> > Setting it to ### would cut off the decimal part, colleague Yousfi, which is equivalent to INT(). I, on the other hand, need ROUND().
> >
> > But thank you for pointing out on how to use this Format tab, colleague!
> >
> > Regards,
> >
> > Ilya
>
> Ilya
> Round() is conditionned by
 set decimals to n

>
> SET DECIMALS TO 4
> SET FIXED ON     
> CLEAR
> ? ROUND(1234.1962, 3) && Displays 1234.1960
> ? ROUND(1234.1962, 2) && Displays 1234.2000
> ? ROUND(1234.1962, 0) && Displays 1234.0000
> 

>
> Regards
> Yousfi Benameur

That's right, and if you put ROUND() before formatting - everything comes out correctly. However, if you use INT() before formatting - then 123.45 comes out as 123, and so does 123.89. The "###" formatting, essentially, does the latter. That was my point, colleague.

Regards,

Ilya

ENTIRE THREAD

Rounding an AVG for totals - HOW TO? Posted by Ilya Rabyy @ 8/12/2008 7:54:27 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Anders Altberg @ 8/12/2008 7:58:15 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Ilya Rabyy @ 8/12/2008 8:42:07 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Anders Altberg @ 8/12/2008 9:29:56 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Ilya Rabyy @ 8/12/2008 9:52:22 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Yuri Rubinov @ 8/12/2008 8:18:41 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Ilya Rabyy @ 8/12/2008 9:04:29 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Yuri Rubinov @ 8/12/2008 9:27:40 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Ilya Rabyy @ 8/12/2008 9:59:50 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Yousfi Benameur @ 8/12/2008 9:56:35 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Ilya Rabyy @ 8/12/2008 10:05:39 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Yousfi Benameur @ 8/12/2008 11:19:38 PM
RE: Rounding an AVG for totals - HOW TO? Posted by Ilya Rabyy @ 8/13/2008 5:02:30 PM