• 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
VOTE on formatted strings for AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

VOTE on formatted strings for AppleScript


  • Subject: VOTE on formatted strings for AppleScript
  • From: Philip Aker <email@hidden>
  • Date: Thu, 4 Jun 2009 01:35:37 -0700

This was from the thread "Re: Same code gives different answers in 2 different scripts"

On 4/6/09 10:19 AM, "Chris Page" <email@hidden> wrote:

If you need support in AppleScript for generating formatted strings,
please post an enhancement request (if you haven’t already) and
include specific details about the sort of controls you need.

Because there already exist formatters for numbers and dates in CoreFoundation.framework one might think AppleScript could have an interface to these existing facilities.  I think it would be a relatively easy upgrade to implement. 

What might be advantageous is a discussion of the form the new commands might take.

I will try to summarize what is available in CFNumberFormatter.h.

•Locales:
You may specify a locale -- this will probably be much appreciated those using non-English setups.

•Styles:
Currently available are: none, decimal, currency, percent, scientific, and spell out.
•
Format:
Described at: <http://userguide.icu-project.org/formatparse/numbers>
§

One possibility is to have it look like something we would see in System Events:

set frmt to make new formatter with properties {type:number, locale:"en_US_POSIX", style:decimal, format:"%.9f"}
tell frmt
set numstr to format 0.9
end tell
delete frmt
numstr

But I don't know. Maybe the consensus will be for a command like:

set numstr to format number 0.9 with format:"%.9f" for locale:"en_US_POSIX" using decimal style


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
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

  • Prev by Date: Re: Same code gives different answers in 2 different scripts
  • Next by Date: Re: Word Line Numbers
  • Previous by thread: Re: AppleScript Studio Application - Annoying Delays - Withdrawn
  • Next by thread: Mail's Sent Messages
  • Index(es):
    • Date
    • Thread