loadrunner中将float转化为char

今天一直在LR的函数里找将float类型转化为char类型的函数,只看到将char*转化为其他类型,后来发现可以用sprintf解决。

        Action()
        {
          char* s=(char*)calloc(100,sizeof(char));
          float i;
          strcpy(s,"123");
          i=atoi(s)+4516.32;
          sprintf(s,"%.2f",i);
          lr_message(s);
          free(s);
          return 0;
        }
 

你可能感兴趣的:(action,float,loadrunner)