How to Print Floating Point Data

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Print Floating Point Data

Jump to solution
597 Views
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 Kudos
1 Solution
496 Views
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

View solution in original post

2 Replies
497 Views
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

496 Views
yuboli
Contributor II

Thanks very much,Expanded multiple printing is effective

0 Kudos