如何将CString转换为双指数值 [英] How to convert from CString to double exponential value

查看:79
本文介绍了如何将CString转换为双指数值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的代码如下。

CString string;

string.Format(%e ,1.23456-e246);



这是正确的格式化方式吗?



我的下一个疑问是如何将此格式化的CString转换为双倍。



double d = static_cast< double>(ttof(string));



这是正确的方法吗?



提前谢谢

hi all,
i''ve a code as follows.
CString string;
string.Format("%e",1.23456-e246);

Is this the correct way of formatting?

My next doubt is how can i convert this formatted CString to double.

double d = static_cast<double>(ttof(string));

Is this the correct way?

thank you in advance

推荐答案

string .Format(%e,1.23456-e246);



不对,你需要一个具有该值的变量。



你读到 http://msdn.microsoft。 com / en-us / library / hf4y5e3w(v = vs.71).aspx [ ^ ]



使用_atof函数:



http://msdn.microsoft.com/en-us/library/hc25t012.aspx [ ^ ]



我建议阅读一些基本的东西和教程
string.Format("%e",1.23456-e246);

isnt right, you need a variable with that value.

you read that http://msdn.microsoft.com/en-us/library/hf4y5e3w(v=vs.71).aspx[^]

use the _atof function:

http://msdn.microsoft.com/en-us/library/hc25t012.aspx[^]

I suggest to read some basic stuff and tutorials


这篇关于如何将CString转换为双指数值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆