Re: AW database field and floating point
Re: AW database field and floating point
- Subject: Re: AW database field and floating point
- From: Yvan KOENIG <email@hidden>
- Date: Thu, 27 Oct 2005 13:10:59 +0200
Hello
I had some free time.
Here is a soluce:
property ze_num : 10.800000191
tell application "AppleWorks 6"
activate
tell document 1
set value of field "nombre" of record 2 to my Smart_Round(ze_num, 1)
as text
end tell
end tell
-- Round a number with decimals (by Daniel Varlet)
-- Parameters: number as string, number of decimals as integer
-- Result: real Ex: Smart_Round("19,749", 2) --> 19.75
on Smart_Round(the_number, the_decimal)
return (round (the_number * (10 ^ the_decimal))) / (10 ^ the_decimal)
end Smart_Round
The coercion as text will take care of the used decimal separator.
Yvan KOENIG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden