---
title: "loadrunner的atof函数有问题（转）"
author: "solem"
date: "2010-01-15T16:28:37Z"
tags: []
categories: ["编程语言"]
slug: "loadrunner-atof"
draft: false
lastmod: "2010-01-15T16:29:56Z"
id: 571237
url: "https://solem.iteye.com/blog/571237"
---

```java

float x;
     char *s = "7.2339 by these hilts or I am a villian else";

     x = atof(s);
     /* The %.2f formatting string limits the output to 2 decimal places */
     lr_output_message("%.2f", x);

应输出：7.23  
实际输出为：1244128.00（此值各个机器运行结果可能不同）


```