Skip to content

Commit 7a5a10d

Browse files
committed
show sign if only imaginary impedance exists
1 parent 2833b17 commit 7a5a10d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

smith_chart/js/smith_tool.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,8 @@ function draw_schematic(i) {
13881388
if (schematic[i].imaginary * zo >= 0) innerText += ' + '
13891389
else innerText += ' - '
13901390
}
1391-
if (sch_imag) innerText += Number((Math.abs(schematic[i].imaginary * zo)).toPrecision(precision)) + 'j'
1391+
if (sch_real && sch_imag) innerText += Number((Math.abs(schematic[i].imaginary * zo)).toPrecision(precision)) + 'j'
1392+
else if (sch_imag) innerText += Number((schematic[i].imaginary * zo).toPrecision(precision)) + 'j'
13921393
innerText += '</div>'
13931394
} else if (boxType == 'custom') {
13941395
innerText += '<button type="button" class="btn btn-secondary m-auto" data-bs-toggle="modal" data-bs-target="#customZModal" onclick="createCustomZModal(' + i + ')">Impedance Table</button>';

0 commit comments

Comments
 (0)