• 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: 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


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

  • Prev by Date: Re: Filemaker and syncing Databases... Your comments please.
  • Next by Date: Re: Placing long URLs in email
  • Previous by thread: Re: AW database field and floating point
  • Next by thread: Re. using third-party solutions [was Re: Producing Unicode-only characters]
  • Index(es):
    • Date
    • Thread