• 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: time format, on leadZero(x)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: time format, on leadZero(x)


  • Subject: Re: time format, on leadZero(x)
  • From: Skeeve <email@hidden>
  • Date: Mon, 19 Nov 2007 07:21:43 +0100

tom wible wrote:
nifty idiom i picked up from macscripters:

on leadingZeros(x, n)
    return characters -n thru -1 of "00000000" & x
How about this alternative?
-- *leftfill* of 4711 by "000000" => "004711"
to *leftfill* of aNumber by pattern
  set aNumber to aNumber as string
  set missing to (length of pattern) - (length of aNumber)
  if missing <= 0 then return aNumber
  return (text 1 thru missing of pattern) & aNumber
end *leftfill*

_______________________________________________
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: time format, on leadZero(x)
      • From: Skeeve <email@hidden>
References: 
 >Re: time format, on leadZero(x) (From: tom wible <email@hidden>)

  • Prev by Date: Re: Adobe Illustrator CS3 'save' command appears to be buggy
  • Next by Date: Re: time format, on leadZero(x)
  • Previous by thread: Re: time format, on leadZero(x)
  • Next by thread: Re: time format, on leadZero(x)
  • Index(es):
    • Date
    • Thread