This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

基于TMS320F28335 实现float型转同样数值的字符串型

Other Parts Discussed in Thread: TMS320F28335

我想基于TMS320F28335 实现float型转同样数值的字符串型,例如0.354转化为“0.354”,我在程序里使用sprintf函数,程序运行完sprintf后就貌似跑飞了,后边的程序都不执行了,具体操作如下:


main.c里添加
#include<stdio.h>

main函数里添加
char buf[100];
sprintf(buf,"%.3f",(double)0.032);

请帮忙看下,该怎么使用sprintf函数呢? 或者有没有其它方法能 实现float型转同样数值的字符串型。非常感谢了!!

  • 我在使用28335设计液晶显示的程序时,也遇到了同样的问题——如何将float 转换为字符串,目前还没有解决了。同样求解!