# Thread: How to Determine Data Ratio Value

1. ## How to Determine Data Ratio Value

I'm coding a website using HTML and JavaScript, and the source code I have uses a data-ratio value to determine the size of an image. My question is, how do I determine this value based on the dimensions of my image?

<div class='slide template1' data-ratio='1.44' data-background='#fff'><img src='img/filename.jpg' width='1800' height='1250' alt='' /></div>

If my dimensions are 1800 x 1250, how do I calculate a value like 1.44?

After experimenting with this code, a square image has a data-ratio of 1.0. Also, a tall, vertical image has a ratio of LESS than 1.
<div class='slide template1' data-ratio='.7'data-background='#fff'><img src='img/vertical-image.jpg' width='1000' height='1500' alt='' /></div>
Is anyone familiar with this data-ratio value and how to calculate it?

Thanks!

2. ## Re: How to Determine Data Ratio Value

$1.44 = \dfrac{1800}{1250}$

so I'm gonna guess the number you're after is $\dfrac{w}{h}$

3. ## Re: How to Determine Data Ratio Value

Well, there you go! Simple as that!

Thanks so much and Happy Holidays.