Re: rounding integers
Re: rounding integers
- Subject: Re: rounding integers
- From: Shane Stanley <email@hidden>
- Date: Thu, 13 Nov 2003 11:47:50 +1100
On Nov 1, 2003, at 5:11 AM, Paul Berkowitz wrote:
You need OS 10.3 (AS 1.9.2) for '[real] as integer' coercion to work.
Picking up on an old thread...
I have a couple of scripts where I used the "as integer" coercion and a
try construct to validate values, and of course some of these now fail.
I'm trying to figure out the best approach to take.
In playing with things, I've noticed that you can coerce a value 67.5
to an integer, and a string like "67" to an integer, but you still
can't coerce a string like "67.5" to an integer:
set x to 67.5
x as integer
set x to "67.5"
set x to x as number
x as integer
set x to "67.5"
x as integer --> Can't make "67.5" into a integer.
Because I'm often validating values that are entered as strings anyway,
in a lot of cases I don't need to change anything. But the
inconsistency troubles me, and I'm wondering whether in fact this is
just an oversight/borderline bug that is likely to be "fixed" at some
future date, and that I might as well change my approach now. Or is
there likely to be some reason behind this difference in behavior?
--
Shane Stanley <email@hidden>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.