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

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
Conversion Iteration #2: Color

Conversion Iteration #2: Color

For iteration #2: I added Hex color to RGB to the conversion app page converter. Hex: This will take the 6-digit hex color only accepting 0-9 and A-F. Then it will convert the Hex to RGB with commas between the 3 color grouping. RGB: For the RGB to Hex the user will...

read more
Using Databases in Python

Using Databases in Python

For my next project I wanted to work with a database in Python. Since databases are used in about every major coding situation I wanted to a project that would be close to a real world project. Spent time in January doing basic exercises/classes with Python with...

read more

Pin It on Pinterest

Share This