Re: numbers and prefix zero
Re: numbers and prefix zero
- Subject: Re: numbers and prefix zero
- From: kai <email@hidden>
- Date: Sat, 12 Feb 2005 19:20:55 +0000
On Sat, 12 Feb 2005 17:36:54 +0100, Christian Vinaa <email@hidden>
wrote:
so the short version is:
set a to 10
set b to (text -2 thru -1 of ("00" & (a + 1)))
For a slightly shorter 2-digit version, you might try losing a "0" -
and maybe even a couple of parentheses:
set b to text -2 thru -1 of ("0" & a + 1)
Alternatively, it can sometimes be a bit faster to calculate, rather
than to concatenate:
set b to text -2 thru -1 of (100 + a + 1 as string)
Of course, to deal with negative 2-digit values, you'll need to do a
bit more than that. But, hey - if there's a snow blizzard outside
anyway... ;-)
---
kai
_______________________________________________
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