A
A
asdasa212020-04-22 14:27:10
JavaScript
asdasa21, 2020-04-22 14:27:10

What is wrong in the code, why NaN?

Displays NaN in the line N_pr - as I understand it because of A_kzg and A_tg - the data is numeric, because I counted them before.

A_kzg = (L_g * (Math.pow(W_kzg,2)) * R_g/(2 * (D_vn - D_n))).toFixed(1);
A_tg = (0.0244 * (Math.pow(W_tg,2)) * R_d/(2 * Nkt_vn)).toFixed(2);
N_pr = ((Q_st - 0.1) * 1000000/(9.81 * (R_d - R_g) + A_kzg + A_tg)).toFixed(1);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2020-04-22
@asdasa21

.toFixed()makes a string, text out of a number.
It's better to count everything in numbers.
And all these should .toFixed()be used immediately before the conclusion.

H
hzzzzl, 2020-04-22
@hzzzzl

variable names ;(

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question