Milestone 2 Output 'NaN'


When I run the python file, I get response 200
but the output is shown in the pic.
What should I do?

Just check the data type you are passing to the frontend.

Check the code where you are calculating Annualized Returns as there might be a fault somewhere in the logic and the final result you are returning.Check the datatype you return as @namanaggarwal mentioned.

@Goutham
Maybe this can help you : https://www.baeldung.com/java-not-a-number
You can think of how NaN was generated.

Hi @Goutham,

I’ll recommend you to look up what Nan means and how it is generated. Once you have that knowledge, please go through your code and see where this happening with the buyPrice and sellPrice of stocks, as I believe because of that both values of annualizedReturns object are being null.

Once you try that, let me know if you face any issues!

I’m closing this topic due to no response from anyone since last 15 hours. If your query is resolved you can mark any reply as a solution. If you still have the query, please create a new topic paste the link of this topic in the description.