• 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: Round a number towards zero!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Round a number towards zero!


  • Subject: Re: Round a number towards zero!
  • From: deivy petrescu <email@hidden>
  • Date: Fri, 18 Mar 2005 14:49:31 -0500


On Mar 18, 2005, at 12:43, Nigel Garvey wrote:

Marcus Rodrigues wrote on Fri, 18 Mar 2005 10:32:23 -0300:

Hi people, I need some help!

How do I tell an script to round some number towards zero?

myNumber div 1


NG


Here:

set myNumber to 83.65

set myNumber rounded to round myNumber
if myNumberrounded > myNumber then
set mycorrection to 1
else if myNumberrounded = myNumber then
set mycorrection to 0
else
set mycorrection to 0
end if
set myNumberrounded to myNumberrounded - mycorrection


Don't listen to Nigel, he makes things look too simple!

:)









deivy
--------------------------------------------
Agora quem da bola é o Santos,
Salve o novo campeão!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Round a number towards zero! (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: Round a number towards zero!
  • Next by Date: How to duplicate or alias a file in Finder?
  • Previous by thread: Re: Round a number towards zero!
  • Next by thread: Re: Round a number towards zero!
  • Index(es):
    • Date
    • Thread