+ 1
[Help needed] Javascript practise - currency converting
Hi all ! I have difficulties to achieve this practise. This is my code and I can't see what is wrong. I have the error "NaN" in every test cases... function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); function convert(montant, taux) { var nvxMontant = montant * taux; return nvxMontant; } console.log(convert(amount, rate)); } main(); Could someone help me please ?
2 odpowiedzi
+ 3
In Sololearn challenges, main() function is called by compiler itself. It's not necessary to call in your solutions.
//main();
+ 1
Thanks !