如何将CZEC CString Value转换为浮点值 [英] How to convert CZEC CString Value to float value
问题描述
大家好,
我想将 CString 值转换为CZECH支持的浮动(检查共和国)。
示例:转换为CZECH时。
-------
CString valStr;
valStr =100,34(转换为CZEH时存在逗号)。
现在通过c函数 atof(valStr)转换为浮点值我得到了100.00
截断值34.
i必须得到结果为100.34请建议如何执行此senario
$ b在计算机中执行CZEH语言在区域语言设置中的$ b。
谢谢,
uday。
Hi All,
I want to convert CString value to float supported by CZECH (Check Republic).
Example : When Converted to CZECH.
-------
CString valStr;
valStr = "100,34" (Comma is present when convert to CZEH).
Now when converting to float value by c function atof(valStr) i am getting 100.00
truncating the value 34.
i have to get the result as 100.34 Please suggest how to perform this senario
for CZEH languge in reginal laguage settings is performed in Computer.
Thanks,
uday.
推荐答案
您需要添加捷克语区域设置的区域设置信息,如 http://msdn.microsoft.com/en-us/library/hc25t012.aspx [ ^ ],在函数中:
You need to add the locale information for Czech locale, as described in http://msdn.microsoft.com/en-us/library/hc25t012.aspx[^], at the function:
double _atof_l(
const char *str,
_locale_t locale
);
这篇关于如何将CZEC CString Value转换为浮点值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!