Last week, I started a (hopefully) weekly post where I throw out a (hopefully) useful piece of code for people to (hopefully) use in their projects. I’m calling this #SnippetSaturday.
John Lindquist commented almost immediately that there is a project on github designed to collect these sorts of useful little snippets of code. It’s called as3-utils. Check it out!
This week’s snippet, isRoughlyEqual(), provides a simple way to find out if two numbers are in the ballpark of each other.
I’ve added it to the as3-utils project too.
http://github.com/mimshwright/as3-utils/blob/master/src/utils/number/isRoughlyEqual.as