• 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: String to real conversion question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String to real conversion question


  • Subject: Re: String to real conversion question
  • From: Michelle Steiner <email@hidden>
  • Date: Sun, 2 May 2010 09:43:25 -0700

On May 2, 2010, at 9:35 AM, Bert Groeneveld wrote:

-- Don't know if this is the smartest way for a find and replace action, but here's how I worked around it . . .

set x to "0.25" -- string
set y to "4" -- string

if x contains "." then
set AppleScript's text item delimiters to "."
set x to every text item of x as list
set AppleScript's text item delimiters to ","
set x to x as string
set AppleScript's text item delimiters to ""
end if
set z to x * y --> 1.0

But what if x is greater than one thousand, and is formatted something like "2,341.25"?

-- Michelle

-- 
A great Idea!  That's what we need--a great idea.
 --Pseudolus, (A Funny Thing Happened on the way to the forum)

 _______________________________________________
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

  • Follow-Ups:
    • Re: String to real conversion question
      • From: Bert Groeneveld <email@hidden>
References: 
 >String to real conversion question (From: Bert Groeneveld <email@hidden>)
 >Re: String to real conversion question (From: "Mark J. Reed" <email@hidden>)
 >Re: String to real conversion question (From: Bob Studer <email@hidden>)
 >Re: String to real conversion question (From: Bert Groeneveld <email@hidden>)

  • Prev by Date: Re: String to real conversion question
  • Next by Date: Re: String to real conversion question
  • Previous by thread: Re: String to real conversion question
  • Next by thread: Re: String to real conversion question
  • Index(es):
    • Date
    • Thread