Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Samir H.
  Where is Samir H.?
 Yogyakarta
 Indonesia
 Samir H.
 To: joe Degorio
  Where is joe Degorio?
 Tacloban City
 Philippines
 joe Degorio
 Tags
Subject: RE: Rounding
Thread ID: 289085 Message ID: 289096 # Views: 42 # Ratings: 2
Version: Visual FoxPro 9 Category: Forms
Date: Tuesday, December 28, 2010 10:32:33 AM         
   


> Hi,
> Advance Happy New Year to everyone! And just want to ask how can I round these numbers to the following (if possible)...
>
> 195.34 -> 195.35
> 85.22 -> 85.25
> 900.72 -> 900.75
>
> thanks and regards,
> joe


Extended from Ony's code:
n = 195.30
? IIF(n%.05=0,n,n + (.05 - (n % .05)))

Regards
Samir

ENTIRE THREAD

Rounding Posted by joe Degorio @ 12/28/2010 9:28:25 AM
RE: Rounding Posted by Ony Too @ 12/28/2010 9:47:05 AM
RE: Rounding Posted by Samir H. @ 12/28/2010 10:32:33 AM
RE: Rounding Posted by Luis Maria Guayan @ 12/28/2010 3:33:33 PM