• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Rounding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rounding


  • Subject: Re: Rounding
  • From: Malcolm Fitzgerald <email@hidden>
  • Date: Wed, 20 Mar 2002 16:32:27 +1100

whoops, I forgot the boundary condition

to round_up(i, r)
if i mod r = 0 then return i
return i + r - (i mod r)
end round_up

Howdy,

I need to extract the minutes from the time string of current date and then round them up to the next 5 minute increment. I can extract the minutes with no problem but the rounding is my weak spot (my loss of mathematical ability is documented in the archives of this list). :P

So, how do I round 14 to 15, or 16 to 20? Does anyone care to share a handler which addresses this?

Thanks for any help that you might offer.
--
Later,

Rob Jorgensen
Ohio, USA
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

--
Malcolm Fitzgerald
Database Manager
The Australian Society of Authors

ph: 02 9318 0877 fax: 02 9318 0530 email: email@hidden
www.asauthors.org www.asauthors.org/award www.asauthors.org/web_of_poets
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Rounding (From: Rob Jorgensen <email@hidden>)

  • Prev by Date: Re: Progress Bar for OS X?
  • Next by Date: Re: mount volume stopped working
  • Previous by thread: Re: Rounding
  • Next by thread: Re: Rounding
  • Index(es):
    • Date
    • Thread