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: Wed, 26 Oct 2005 22:35:52 +0200
Le 26 oct. 2005 , à 22:08, Jan E. Schotsman a écrit :
On 26-okt-05, at 19:25, Yvan KOENIG wrote:
Hello,
how can I set floating point values in a number field of an
AppleWorks
database with a given precision?
For example, 10.8 now ends up as 10.800000191. I want it to stay
10.8.
TIA,
Always use the ROUND() function
How can I do this in a script please?
"set myVar to floatValue" becomes??
One trick is to put the value in a complementary field named 'rawValue'
for instance
and use a calculated field name 'formattedValue' for instance
whose formula is
Round('rawValue',1)
Without such a formula, you are hitting the limits of the precision
available.
You may perhaps (but I didn't check) coerce your value as a string
(take care of the decimal separator wich is not the same worldwide) and
pass the string to the field.
If I remember well, using this trick will pass the correct decimal
digits as it doesn't use the AS's internal representation of numbers.
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