Number of Decimal Places
Number of Decimal Places
- Subject: Number of Decimal Places
- From: Goldfish <email@hidden>
- Date: Mon, 22 Apr 2002 16:00:37 -0400
Hi. Here is an open challenge:
I would like to, in the fewest lines of code, determine the number of
decimal places of a "real" named x.
For instance, "1" would be 0, "1.1" would be 2, "1.11" would be 3, etc.
Using the following guide, I'd like to know who can come up with the
fewest lines of code to return the correct number of decimal places:
--Use this code:
set x to (the text returned of (display dialog "Number:" default
answer "")) as real
--Code
display dialog "The number of decimal places of " & x & " is " &
decimalplaces
Good luck.
-Goldfish
_______________________________________________
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.