Digikey's cap. conversion calculator is wrong when converting nF to Farads? - Page 1
Forum section: electronics / beginners

author: akos_nemeth
author_rank: Contributor
timestamp: January 13, 2017, 12:07:36 am
content: Hi All,I tried to convert 100nF to Farads, and I think it is 100/1 000 000 000 = 1 * 10-7, but Digikey's calculator (http://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-capacitance) says it is 1*10-8.An other calculator (http://www.unit-conversion.info/capacitance.html) says it is 1 * 10-7. So I guess nobody noticed, since nobody uses Farads for anything practical?First image is a screen capture from the Digikey calculator's result, the second is from the result of the "Capacitance Unit Converter".Regards,Ákos

author: MK14
author_rank: Super Contributor
timestamp: January 13, 2017, 12:22:36 am
content: If you look at the code (view page source, JavaScript), there seems to be one too many zeros, on line 271.if (pOption == "nF") {document.getElementById("nF1").value = pIn;document.getElementById("uF1").value = parseFloat((pIn * 0.001).toFixed(12));document.getElementById("F1").value = parseFloat((pIn *0.0000000001).toFixed(12));document.getElementById("pF1").value = parseFloat((pIn * 1000).toFixed(12));};Code:if (pOption == "pF") {document.getElementById("pF1").value = pIn;document.getElementById("uF1").value = parseFloat((pIn * .000001).toFixed(12));document.getElementById("nF1").value = parseFloat((pIn * 0.001).toFixed(12));;document.getElementById("F1").value = parseFloat((pIn * 0.000000000001).toFixed(12));};if (pOption == "uF") {document.getElementById("uF1").value = pIn;document.getElementById("nF1").value = parseFloat((pIn * 1000).toFixed(12));document.getElementById("F1").value = parseFloat((pIn * 0.000001).toFixed(12));document.getElementById("pF1").value = parseFloat((pIn * 1000000).toFixed(12));};if (pOption == "nF") {document.getElementById("nF1").value = pIn;document.getElementById("uF1").value = parseFloat((pIn * 0.001).toFixed(12));document.getElementById("F1").value = parseFloat((pIn * 0.0000000001).toFixed(12));document.getElementById("pF1").value = parseFloat((pIn * 1000).toFixed(12));};if (pOption == "F") {document.getElementById("F1").value = pIn;document.getElementById("uF1").value = parseFloat((pIn * 1000000).toFixed(5));document.getElementById("nF1").value = parseFloat((pIn * 1000000000).toFixed(5));document.getElementById("pF1").value = parseFloat((pIn * 1000000000000).toFixed(5));}

author: Benta
author_rank: Super Contributor
timestamp: January 13, 2017, 12:28:54 am
content: Who cares about Digikey?My HP15C gets it right every time

author: akos_nemeth
author_rank: Contributor
timestamp: January 13, 2017, 01:17:41 am
content: Quote from: MK14 on January 13, 2017, 12:22:36 amHi MK14,I have sent them a mail, with your finding this will be a very easy ticket for the web developer.Regards,Ákos

author: MK14
author_rank: Super Contributor
timestamp: January 13, 2017, 07:24:23 am
content: Quote from: akos_nemeth on January 13, 2017, 01:17:41 amThanks for doing that!I hoped you would, and toyed over suggesting that in my original post.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: January 13, 2017, 08:30:42 am
content: Digikey always seem to have had a problem acknowledging that nanofarads are a thing

author: Zero999
author_rank: Super Contributor
timestamp: January 13, 2017, 08:41:50 am
content: I've never seen the point in those calculators. I can perform the conversion in my head faster than typing the numbers in.For some reason, nF is less common in the states than Europe. I don't know why. It's certainly neater to write 4.7nF than it is to write 4700pF, 0.0047µF or 4.7e-9F.

author: amyk
author_rank: Super Contributor
timestamp: January 13, 2017, 11:58:12 am
content: That code is pretty horrible, even ignoring the fact that you canwrite numbers directly in 1ennotationin JS it looks like someone just copy-pasted the same block and changed it multiple times. Just map into exponents (e.g. ["pF", "nF", "uF", "F" ] into [-12, -9, -6, 1]), find difference between in and out exponents for each field, and multiply by 10^n. I get the feeling whoever wrote it doesn't understand SI.

author: jpanhalt
author_rank: Super Contributor
timestamp: January 13, 2017, 12:58:23 pm
content: Quote from: amyk on January 13, 2017, 11:58:12 amJust a small point...is the exponent for F a 1 or 0? That is, 62 pF = 62 X 10E-12; 3 F = 3 x 10E0John

author: Brumby
author_rank: Unknown
timestamp: January 13, 2017, 01:11:17 pm
content: It is a 0.