|Aug 14, 2006, 12:39 PM||#1|
How to edit number precision in Applescript??
I have been learning Applescript recently and I can't figure out how to format the precision of a number. I have looked through forums and have looked through a couple of books as well as the Applescript Language Guide.
The "round" command comes close but isn't exactly what I need.
What I need in the end it to round numbers to the nearest two decimal places.
example : 18.094898203 to 18.09
Thanks for any help!
|Aug 14, 2006, 01:23 PM||#2|
(* format is roundThis(inDec, precision) *) roundThis(75.5436, 1) --this will round to 75.5 on roundThis(n, numDecimals) set x to 10 ^ numDecimals (((n * x) + 0.5) div 1) / x end roundThis
Obama is a true statesman whose experience as a state senator, half-term US Senator & guest lecturer in a Constitutional Law class has fully prepared him to take control of our nuclear arsenal.-Me
|Aug 15, 2006, 02:49 PM||#4|
Can't you just use a double variable?
Then again, I have not gone that in depth into applescript using numbers, that's where I just fall back to Java.
EDIT: Applescript doesn't support double types. Not suprised, but it's kind of an expected features, you know?
Last edited by SC68Cal; Aug 15, 2006 at 02:58 PM.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|how to edit number before calling||phuong||iPhone||8||Oct 1, 2011 03:24 AM|
|How to edit themes menu in iWeb?||Gloor||Web Design and Development||1||Dec 9, 2009 05:27 PM|
|How to Edit like this in Final Cut Pro?||FSMBP||Digital Video||3||Nov 16, 2009 10:12 PM|
|Font style conflicts - how to edit font style in font file?||ProMod||Design and Graphics||0||Feb 25, 2009 01:38 PM|
|how to edit midi velocities in logic?||ashjamben||Digital Audio||2||May 2, 2008 02:56 AM|
All times are GMT -5. The time now is 07:01 AM.