Author Topic: Digikey's cap. conversion calculator is wrong when converting nF to Farads?  (Read 1777 times)

0 Members and 1 Guest are viewing this topic.

Offline akos_nemeth

  • Contributor
  • Posts: 30
  • Country: hu
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
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 2580
  • Country: gb
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: [Select]
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));
}
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 2463
  • Country: de
Who cares about Digikey?

My HP15C gets it right every time  ;D

 

Offline akos_nemeth

  • Contributor
  • Posts: 30
  • Country: hu
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: [Select]
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));
}

Hi MK14,

I have sent them a mail, with your finding this will be a very easy ticket for the web developer.  ;D

Regards,
Ákos
 
The following users thanked this post: MK14

Offline MK14

  • Super Contributor
  • ***
  • Posts: 2580
  • Country: gb
Hi MK14,

I have sent them a mail, with your finding this will be a very easy ticket for the web developer.  ;D

Regards,
Ákos

Thanks for doing that!

I hoped you would, and toyed over suggesting that in my original post.
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12136
  • Country: gb
    • Mike's Electric Stuff
Digikey always seem to have  had a problem acknowledging that nanofarads are a thing
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 14389
  • Country: gb
  • 0999
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.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 6848
That code is pretty horrible, even ignoring the fact that you can write numbers directly in 1en notation in 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. :palm:
 

Offline jpanhalt

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: us
That code is pretty horrible, even ignoring the fact that you can write numbers directly in 1en notation in 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. :palm:

Just a small point...is the exponent for F a 1 or 0?  That is, 62 pF = 62 X 10E-12; 3 F = 3 x 10E0

John
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 10109
  • Country: au
It is a 0.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf