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

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
Save posts to a WordPress Database – Working Notes

Save posts to a WordPress Database – Working Notes

This is notes/overview of a project I started on to add several posts to WordPress (WP) from HTML files without having to copy and paste each file. These are just notes from that dropped project and the basic Python script to do this (github). Make sure you fully test...

read more
CMYK converter added

CMYK converter added

CMYK is a tricky one, since each device would interpret the colors differently. Had almost decided not to even include it but thought it could be useful at times. Looking around I found a basic formula that most people were using to give a rough idea for the color. I...

read more

Pin It on Pinterest

Share This