Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Addition with decimal React Native doesnt return number

I am in a project building simple mathematic app with react native. but when my input is added with decimal number, it doesnt sum, but it just merge

var height = 56
const convertHeight = height+0.7

it return 560.7, instead of 56.7

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Javascript is funny

Try

var height = 56
const convertHeight = height*1.0+0.7
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading