Home > Blockchain >  Addition with decimal React Native doesnt return number
Addition with decimal React Native doesnt return number

Time:06-30

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

CodePudding user response:

Javascript is funny

Try

var height = 56
const convertHeight = height*1.0 0.7
  • Related