You are reading a single comment by @rwaldron and its replies. Click here to read the full conversation.
  • If the value is actually a floating point number, but you're receiving a string, then you should be able to simply coerce the value to a number and the non-numeric characters will be discarded:

    var ph = "8.55\r\n";
    
    +ph === 8.55; // true
    

    Unfortunately, that doesn't seem to work correctly in Espruino. I've filed a bug: https://github.com/espruino/Espruino/iss­ues/268

About

Avatar for rwaldron @rwaldron started