How to convert pixel into inches in rulers using javascript

2.5k views Asked by At

I working in jquery.rulers.js function, and i create rulers for particular div and it shown properly in pixel and it convert into inches it will shown same measurement.

For example :

i have 100 pixel in my div it will shown 1'0" ,200 pixel in my div it will shown 2'0" and so on.when i converted pixel into inches it shown different.Which one is correct? i much more struggle in pixel to inches conversation.

Here my working FIDDLE

But it shown only pixel values in inches.but it not properly shown inches values.I need proper guidelines..and i need any formula for this conversation.

NOTE:

I have used only 150 DPI (Dotted Per Inch) for image conversation. REFER URL

1

There are 1 answers

0
VIVEK-MDU On BEST ANSWER

I found that answer for my own question. I can divide given pixel into DPI(dotted per Inch).

For example : 100pixel for particular div divided by 150 DPI(or 96 DPI).

Result Inches = PIXEL/DPI;(Dotted Per Inches)

Here i update my FIDDLE.