What's the easy way to do this? (convert string to num without excess chars)
What's the easy way to do this? (convert string to num without excess chars)
- Subject: What's the easy way to do this? (convert string to num without excess chars)
- From: email@hidden
- Date: Thu, 27 Jun 2002 04:23:56 EDT
-- given string SomeCMMeasure = "1.0234 cm", then
set TheMeasure to ((characters 1 thru -4 of SomeCMMeasure as string) as
number)
-- this should result in trimming the last three characters of the string
-- and coerce it to a number
set TheMeasure to (TheMeasure + 1)
-- or whatever math you need to do
set SomeCMMeasure to ((TheMeasure as string) & " cm") as string
-- reconvert it to the expected string format.
Meanwhile, if Shane Stanley's solution works for your needs, it appears
cleaner (fewer steps too) and I'd recommend it.
=-= Marc
Date: Wed, 26 Jun 2002 13:42:44 +0100
Subject: What's the easy way to do this?
From: Steve <email@hidden>
[snip]
Is there a better way to achieve this? "1.234 cm" - " cm" = "1.234" than
checking each character?
Thanks,
Steve
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.