• 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: Decimal Point Truncations?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Decimal Point Truncations?


  • Subject: Re: Decimal Point Truncations?
  • From: Jed Verity <email@hidden>
  • Date: Thu, 08 Feb 2001 10:28:54 -0800

What about something like this:

set diskSize to diskSize as string
set trunkSize to text 1 thru ((offset of "." in diskSize)+1) of diskSize

HTH,
Jed

On 2/8/01 10:08 AM, Gregory Smith uttered these immortal words:

> Hello,
>
> I'm having a problem truncating decimals. Can anyone help?
>
> Example:
>
> set diskSize to free space of startup disk
> --> script code to recalculate diskSize variable to Gb <--
> display dialog diskSize
>
> I want to get the disk size and display the result in Gb with one decimal
> place (If possible). Currently, the full code above gets something like
> 54.6464646748783838. I would like it to display 54.6. I've tried rounding
> and it returns the same 54.6464646748783838 for some reason that escapes me.
>
> As always, thanks in advance!
> --
>
> Cheers,
> Greg Smith
> _______________________________________________
> applescript-users mailing list
> email@hidden
> http://www.lists.apple.com/mailman/listinfo/applescript-users
>


~)~)~)~)~)~)~)~)~)~)~)~)~)
Jed Verity


  • Follow-Ups:
    • Re: Decimal Point Truncations?
      • From: Jolly Roger <email@hidden>
References: 
 >Decimal Point Truncations? (From: "Gregory Smith" <email@hidden>)

  • Prev by Date: Decimal Point Truncations?
  • Next by Date: Re: Decimal Point Truncations?
  • Previous by thread: Decimal Point Truncations?
  • Next by thread: Re: Decimal Point Truncations?
  • Index(es):
    • Date
    • Thread