How to Print Floating Point Data

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to Print Floating Point Data

ソリューションへジャンプ
602件の閲覧回数
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 解決策
501件の閲覧回数
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 返答(返信)
502件の閲覧回数
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

501件の閲覧回数
yuboli
Contributor II

Thanks very much,Expanded multiple printing is effective

0 件の賞賛