• 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: Christian Vinaa <email@hidden>
  • Date: Fri, 18 Mar 2005 15:38:07 +0100

Le 18 mars 2005 , à 14:32, Marcus Rodrigues a écrit :

Hi people, I need some help!

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

Thx!


Hello

The Standard Additions dictionary claims:


round: Round number to integer
round  real -- the number to round
[rounding  up/down/toward zero/to nearest/as taught in school] -- the rounding direction; if omitted, rounds to nearest. ³to nearest² rounds .5 cases to the nearest even integer in order to decrease cumulative errors. To always round .5 away from zero, use ³as taught in school.²
Result:   integer -- the rounded value



Yvan KOENIG



ok, how do I then fx round to x decimals ? (and not to zero )

ex:

US style    1,000.1234   --> 1,000.12

Euro style   1.000,1234  -->  1.000,12

where 0,1,2,3,4 gets rounded down  and 5,6,7,8,9 gets rounded up

--
Christian Vinaa

...... Meanwhile, aunt Martha, having taken a tramp in the woods,
is lying in a ditch at the edge of town .........................
_______________________________________________
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


  • Follow-Ups:
    • Re: Round a number towards zero!
      • From: Jeff Shapiro <email@hidden>
    • Re: Round a number towards zero!
      • From: Martin Orpen <email@hidden>
References: 
 >Round a number towards zero! (From: Marcus Rodrigues <email@hidden>)
 >Re: Round a number towards zero! (From: yvan-koenig <email@hidden>)

  • Prev by Date: Re: Unicode Codepoints
  • Next by Date: Re: Unicode Codepoints
  • Previous by thread: Re: Round a number towards zero!
  • Next by thread: Re: Round a number towards zero!
  • Index(es):
    • Date
    • Thread