I've been using a simple little script for rounding numbers to the hundredths decimal place, however I've noticed that when the number ends in zero, it rounds up to the next decimal place. I need to preserve this decimal place.
For example: 7.49908302 would be rounded to 7.5 instead of 7.50.
How can I keep the hundredths decimal with this subroutine? Should I try something Perl or Objective C, as I've been told Applescript isn't the best for this sort of thing.
Here's the call:
set finalAge514years to (roundThis(age514years, 2))
Here's my rounding subroutine:
on roundThis(n, numDecimals)
set x to 10 ^ numDecimals
(((n * x) + 0.5) div 1) / x
end roundThis