• 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: How can I format an integer ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I format an integer ?


  • Subject: Re: How can I format an integer ?
  • From: Andrea D'Amore <email@hidden>
  • Date: Thu, 6 Nov 2008 09:21:25 +0100


On 05/nov/08, at 00:22, Philip Aker wrote:

on FormatInt(theNum, theSeparator)
if theNum > 999 then return (FormatInt(theNum div 1000, theSeparator) & theSeparator & text
-3 thru -1 of ("00" & ((theNum mod 1000) as text)))
return theNum as text
end FormatInt
FormatInt(9.99999999E+8, ",")

The example above doesn't give expected result on my system, I get "999,999,9,0" .
From what I can see there's a problem coercing a real in exponential form to integer, last comma is due to my locale setting.




Andrea
_______________________________________________
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: How can I format an integer ?
      • From: Peter Waibel <email@hidden>
    • Re: How can I format an integer ?
      • From: AndrĂ© Berg <email@hidden>
    • Re: How can I format an integer ?
      • From: Philip Aker <email@hidden>
References: 
 >Re: How can I format an integer ? (From: Barry Wainwright <email@hidden>)
 >Re: How can I format an integer ? (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Did anyone try to script Bento 2?
  • Next by Date: Re: How can I format an integer ?
  • Previous by thread: Re: How can I format an integer ?
  • Next by thread: Re: How can I format an integer ?
  • Index(es):
    • Date
    • Thread