Re: How can I format an integer ?
Re: How can I format an integer ?
- Subject: Re: How can I format an integer ?
- From: Luther Fuller <email@hidden>
- Date: Sat, 25 Oct 2008 20:03:52 -0500
It must be getting too late. I escaped the repeat on mod not div.
Here is the correct code.
on format(nr, formatChar)
set chunkList to {}
repeat
set chunk to text -1 thru -3 of ("000" & ((nr mod 1000) as integer))
set chunkList to {chunk} & chunkList
set nr to nr div 1000
if nr = 0 then exit repeat
end repeat
set AppleScript's text item delimiters to {formatChar}
return chunkList as text
end format ------------------
_______________________________________________
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