// NvOSD_TextParams *txt_params = &obj_meta->text_params;
gfloat confidenceo= obj_meta->confidence;//0.78223322
//int con_j=(int)(confidenceo*100);
//gfloat confidencef=con_j*0.01F;
char confidenceC[4];
sprintf(confidenceC,"%.2f",confidenceo);//0.78得到了,并且传递给char数组
NvOSD_TextParams *txt_params = &obj_meta->text_params;
// txt_params->display_text = g_malloc0 (MAX_DISPLAY_LEN);
snprintf(txt_params->display_text+5, MAX_DISPLAY_LEN,confidenceC)//deepstream并进行显示
#include <stdio.h>
int main()
{
float PI=3.1415926;
float R=5.3;
printf("面积 = %.2f\n", PI * R * R); //输出:面积 = 88.25
printf("面积 = %f\n", PI * R * R); //输出:面积 = 88.247337
printf("面积 = %.8f\n", PI * R * R); //输出:面积 = 88.24733734
return 0;
}