Re: International number formats
Re: International number formats
- Subject: Re: International number formats
- From: yvan-koenig <email@hidden>
- Date: Fri, 25 Feb 2005 14:26:37 +0100
Hello
As a french user, even if the dot is not the official character used as
column separator (here it is the space), I often use this simple piece
of code:
property separateurDecimal : "" -- globale
on run
set separateurDecimal to character 2 of (0.1 as text)
(* prépare la gestion des nombres *)
set n1 to (my normalise("1 234,56")) as number
display dialog "" & n1
end run
-- ==================
on normalise(a)
if separateurDecimal is "," then
if a contains "." then set a to my chercheRemplace(a, ".", "")
else
if a contains "," then set a to my chercheRemplace(a, ",", "")
end if
if a contains " " then set a to my chercheRemplace(a, " ", "")
return a
end normalise
-- ==================
on chercheRemplace(t, TID1, TID2)
set AppleScript's text item delimiters to TID1
set L to (text items of t)
set AppleScript's text item delimiters to TID2
set t to L as text
set AppleScript's text item delimiters to ""
return t
end chercheRemplace
-- ==================
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