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

Received AWS Certified Cloud Practitioner Certificate

Received AWS Certified Cloud Practitioner Certificate

This past weekend I tested and received my AWS Certified Cloud Practitioner certification. When I started training for the test I had very little exposure to AWS. I studied for a little over a month, around 60 hours, before taking the test; which luckily I passed on...

read more
Inventory HTML page to a CSV file

Inventory HTML page to a CSV file

As a New Year’s resolution, not mine, they wanted to make sure their online store, reseller site, inventory was up to date. They wanted to make sure their inventory was cleaned up and make sure that what’s listed on the site matches their own inventory. They had been...

read more
Tic-Tac-Toe in JavaScript

Tic-Tac-Toe in JavaScript

To take a break from the other projects this weekend I worked on a Tic-Tac-Toe game in JavaScript. The basic instructions I had for myself was it needed to be able to be played by 1 or 2 people. I started with creating the game for 2 players. Thinking that if I can...

read more

Pin It on Pinterest

Share This