Double to String conversion

Discussion in 'UDOO NEO' started by William Warke, Dec 20, 2016.

  1. William Warke

    William Warke New Member

    Joined:
    Oct 5, 2016
    Messages:
    7
    Likes Received:
    3
    Has anyone figured out how to reliably convert doubles to strings (String or char*) on the Neo? Mine locks up when I try to run the following code:

    Code:
    double x = 1234.56;
    String s = String(x, 2);
    snprintf doesn't like "%f"s either, so I'm at a loss here.
     
  2. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    I also saw this problem on neo, see here
    The solution that i use for the moment is to send only int from M4 to A9 and convert it in float A9 side with c++ ...
     
  3. William Warke

    William Warke New Member

    Joined:
    Oct 5, 2016
    Messages:
    7
    Likes Received:
    3
    Thanks, I didn't find that thread when I searched for the problem. I'm actually trying to write values to a file, not send them over serial, otherwise I would try your solution. I'll move on over to your thread now...
     
    modjo likes this.

Share This Page