Converting float to char*

后端 未结 7 754
野性不改
野性不改 2021-02-04 01:54

How can I convert a float value to char* in C language?

相关标签:
7条回答
  • 2021-02-04 02:51

    In Arduino:

    //temporarily holds data from vals
    char charVal[10];                
    
    //4 is mininum width, 3 is precision; float value is copied onto buff
    dtostrf(123.234, 4, 3, charVal);
    
    monitor.print("charVal: ");
    monitor.println(charVal);
    
    0 讨论(0)
提交回复
热议问题