• 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: AW database field and floating point
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: AW database field and floating point
      • From: Yvan KOENIG <email@hidden>
References: 
 >Re: AW database field and floating point (From: "Jan E. Schotsman" <email@hidden>)

  • Prev by Date: Re: Set a field of an AppleWorks database
  • Next by Date: Re: Global Find and Replace
  • Previous by thread: Re: AW database field and floating point
  • Next by thread: Re: AW database field and floating point
  • Index(es):
    • Date
    • Thread