• 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: Same code gives different answers in 2 different scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Same code gives different answers in 2 different scripts


  • Subject: Re: Same code gives different answers in 2 different scripts
  • From: "Mark J. Reed" <email@hidden>
  • Date: Thu, 4 Jun 2009 19:37:54 -0400

Some sort of number formatting would be nice, but what should it look
like?  The C printf() format has become a sort of de facto standard -
even crypticity-averse Python uses it - but it doesn't feel very
AppleScripty.  On the other hand, something like "format number as
width 7 with 2 decimal places and leading zeroes" is, I think, a tad
too verbose.  Maybe something akin to BASIC's PRINT USING or Oracle's
TO_CHAR, where the format string includes an explicit placeholder for
each possible output digit, might work.

On 6/4/09, Shane Stanley <email@hidden> wrote:
> On 5/6/09 7:52 AM, "Chris Page" <email@hidden> wrote:
>
>> I understand why that makes a certain sense, but round is a math
>> operation. There are lots of math operations.
>>
>> Formatting a value--numeric or otherwise--as text is a separate
>> operation from rounding, multiplication or, say, concatenation and
>> filtering.
>
> Right, but it's not like there's no precedent for mixing stuff like this. A
> good example is:
>
>  1.5 as integer
>
> This used to throw an error, because of course 1.1 can't be made into an
> integer. Someone decided this wasn't helpful, so now the coercion does a
> rounding operation and then coerces the result of that.
>
> --
> Shane Stanley <email@hidden>
> AppleScript Pro Sessions <http://scriptingmatters.com/aspro>
>
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
>

--
Sent from my mobile device

Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Same code gives different answers in 2 different scripts (From: Chris Page <email@hidden>)
 >Re: Same code gives different answers in 2 different scripts (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Same code gives different answers in 2 different scripts
  • Next by Date: Re: Same code gives different answers in 2 different scripts
  • Previous by thread: Re: “round” command rounding algorithms
  • Next by thread: Re: Same code gives different answers in 2 different scripts
  • Index(es):
    • Date
    • Thread