var string = -526.56;
var string1 = "-526.56";
console.log("string " + string.length)
console.log("string " + string)
console.log("string1 " + string1.length)
console.log("string1 " + string1)
I am getting the length of a float but it is returning undefined
.
What is the correct way to get the length of a float?
Basically i want to make sure that the float is has value. At first I compare it to greater than 0 but then i am getting negative values so I decided to get the length but also it failed the if statement because it is returning undefined.