MACSCRPT Archives

September 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

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

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

Print Reply
Mime-Version:
1.0 (Apple Message framework v752.2)
Content-Type:
text/plain; charset=US-ASCII; delsp=yes; format=flowed
Date:
Mon, 25 Sep 2006 11:03:37 -0400
Reply-To:
Macintosh Scripting Systems <[log in to unmask]>
Subject:
From:
Mark Lively <[log in to unmask]>
In-Reply-To:
Content-Transfer-Encoding:
7bit
Sender:
Macintosh Scripting Systems <[log in to unmask]>
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