• 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: number with one decimal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: number with one decimal


  • Subject: Re: number with one decimal
  • From: Steve Thompson <email@hidden>
  • Date: Mon, 18 Jul 2011 22:04:49 +0100


On 18 Jul 2011, at 20:26, Willem wrote:

It does not work to round things.

As i said, i am stuck

This is how I get round this problem edited to use your variable names:

set resultaat to 82
set theCommand to "echo " & quote & "scale=1;" & resultaat & "/10" & quote & "| bc"
set Resultaatveld to do shell script theCommand

do shell script "echo \"scale=1;82/10\"| bc"
--> "8.2"

The scale command controls the number of decimal places.

Steve

_________________________
Steve Thompson
http://about.me/stetho



 _______________________________________________
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: number with one decimal
      • From: "Mark J. Reed" <email@hidden>
References: 
 >number with one decimal (From: Willem <email@hidden>)

  • Prev by Date: Re: number with one decimal
  • Next by Date: Re: number with one decimal
  • Previous by thread: Re: number with one decimal
  • Next by thread: Re: number with one decimal
  • Index(es):
    • Date
    • Thread