If you have an image that is sized 200x100 you would say the aspect ratio is "2:1" correct? You can figure that out with width/height correct? What if the size was 100x200? Would you say the aspect ratio is "1:2"? If so how do you do the math to get "1:2" instead of ".5:1".
More information:
I have to figure this out in code and format it correctly. Here is as far as I got. Does the following look right?
width = 200 height = 100 if (width > height) { ratio = width/height + ":1" // results in "2:1" } else if (height > width) { ratio = "1:" + height/width // results in "1:2" } else if (width == height) { ratio = "1:1"; }
I'm not even sure I described what I'm trying to do correctly. Sorry!