How to Print Floating Point Data

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to Print Floating Point Data

跳至解决方案
803 次查看
yuboli
Contributor II

Hi, everyone

How do you print floating-point data in ZigBee 3.0?

for example     

float a =0.1;

DBG_vPrintf(TRUE, " a = %f " , a );  

The print result is f,   Why can't you print "a = 0.1"

Can you print floating-point data in Beyond Studio?

0 项奖励
回复
1 解答
702 次查看
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Daniel, I hope you're doing well!

 

Printing floating point variables is resource intensive process, I would recommend as an alternative that you try multiplying the value by a factor of 10 so it can be more easily processed and printed to the debug console. To print an integer value you can use the standard printf format specifiers, such as %d or %i.

 

Please let me know if you have any further questions.

 

Best regards,

Sebastian

在原帖中查看解决方案

2 回复数
703 次查看
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Daniel, I hope you're doing well!

 

Printing floating point variables is resource intensive process, I would recommend as an alternative that you try multiplying the value by a factor of 10 so it can be more easily processed and printed to the debug console. To print an integer value you can use the standard printf format specifiers, such as %d or %i.

 

Please let me know if you have any further questions.

 

Best regards,

Sebastian

702 次查看
yuboli
Contributor II

Thanks very much,Expanded multiple printing is effective

0 项奖励
回复