MACSCRPT Archives

September 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Mon, 25 Sep 2006 11:03:37 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (24 lines)
On Sep 25, 2006, at 10:49 AM, Jason Bourque wrote:

> Hello,
>
> I need to round to the nearest nickel. Any ideas how?
>
> .01 - .05 = .05
> .06 - .09 = .1
>
> Of course this would round all numbers not just below .10, and  
> round dollars
> up if needed. 1.96 = 2.00
>
> Any and all help is appreciated!!!

on RoundToNickle(anum)
	return (round (anum * 20) rounding up) / 20
end RoundToNickle

Trailing 0's are left as an exercise to the reader.

-Mark
The teacher says that I am shining wit!

ATOM RSS1 RSS2