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.

CCS/CC2640R2F: Printing 2 decimal places using Display_printf

Part Number: CC2640R2F

Tool/software: Code Composer Studio

Hi,

I need to print the float value upto 2 decimal places. I am using Display_printf function to print the result. But Display_printf prints upto 4 decimal places by defaults. So I  have gone through forum to get the hints. I had tried it by following way but it is not printing anything.

while(1)

{

/*some code*/

sprintf(buf,"%0.2f",averageVal);

Display_printf(display, 1, 0, "Average= %s \r\n",buf);

}

I have also included the stdio.h.

I have also checked the stack size. It is 4096.

I am using SDK v3.10.

why I am not getting any result on display?