Measurement Conversion created in JavaScript

March 09, 2022
screenshot of converter

Created my own conversion page, some of the reasons for this, you may have run across these issues also: ton of ads on page and overlay ads; the ads and the converter all look the same; the one that made me decide to create my own was the conversion was wrong. While I did research and testing I cannot guarantee that this is 100% accurate. The data I pulled to make the calculation could have been wrong and the testing results I checked against could have been off. However most of the tests usually matched to the equations I used in the program creation.

Graphic design measurements:

This is the basic conversions I keep using in graphic design and web development, thought it best just to keep them all together; since the line between the two is very blurred at times. For pixels I went with the average 96ppi if I find later I need other sizes or only use one size I’ll either add or change that. For the centimeter and millimeter this is a simple conversion but thought it safer to just do both on here.

Computer calculations:

For Computer Binary I kept finding different calculators and conversion numbers I went with the ones that I found the most. An issue with two sites, that I found, didn’t match anything else I checked against, these were both for the binary conversions. There could be different ways in converting for binary I used the 1 MB equals 1024 KB method. Another issue that came up in testing was where it rounded, some would round quickly, like no to two decimals others would have maybe 10 places after the decimal.

I have the numbers fixed to be more precise as needed, but set to a max of 4 from graphic and 8 for computer after the decimal and removes any trailing zeroes.

Page located at: https://www.lynnamacher.com/converter/

Used W3.org for as many of the conversion calculations as possible. The ones they didn’t have I looked online and would check multiple sources and used the most common between them.

https://www.w3.org/TR/css3-values/#absolute-lengths

Related Articles

Website Contact form using AWS

Website Contact form using AWS

For the next iteration of the HTML form was to set it up to send an email to the web owner using AWS. The purpose behind this is, if you have a HTML site and don’t want to purchase a monthly plan or build and maintain server software. Using AWS for this functionality...

read more
HTML with JavaScript contact form

HTML with JavaScript contact form

Link to the form: https://www.lynnamacher.com/pdf/contactForm_V1.html This is created to be basic test for an AWS contact form test. The full form when filled out will send an email through AWS to the site owner. Instead of creating the normal test form I try to...

read more
Sometimes the low-tech approach is the best way

Sometimes the low-tech approach is the best way

Have a family member looking to get me some family videos they had digitized, in one big file, about 80GB (they may not have optimized or know how). The need: The family member’s internet connection isn’t the best and could get disconnected at times, when this happens...

read more

Pin It on Pinterest

Share This