Created
December 30, 2013 16:29
-
-
Save CarlRevell/8184316 to your computer and use it in GitHub Desktop.
Handy-dandy, simple ratio calculator bookmarklet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:var n = prompt("width?"); var d = prompt("height?"); gcd = function(a, b){if (b === 0) return a; return gcd(b, a % b);}; var div = gcd(+n, +d); alert(n/div + ":" + d/div); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment