Hi there,

I’m new to AppleScript and MacScripter.net. I’ve had some experience with programming languages, but not for some time. Essentially, what I’d like to do is get the value of variable and split it into two variables, its integer part and its fractional part, e.g., “3.14159” would become “3” and “.14159.” I formerly used a language where this was possible. In that language, for instance, if “pi=3.14159” then “ipart(pi)” would return “3” and "fpart(pi) would return “.14159.” I know I could create a loop to subtract 1 from the number until the variable is < 1 and return the value to get the fractional part (decimal value). But then I’d have to track how many times the loop occurred (which I wouldn’t know how to do) to get the integer part. I’m assuming AppleScript has a much easier method than having to write a subroutine to do this, but then we all know what happens when we assume things…

Any help would be greatly appreciated.

Thanks,

Dave