Unicode相当于gcvt()方法 [英] Unicode equivalent of gcvt() method
问题描述
大家好,
在我的项目中,gcvt()用于将浮点值转换为char值,现在我们支持unicode,因此我想将浮动值转换为宽字符。
gcvt(FloatValue,5,CharBuffer); //之前用的是
我没有看到任何unicode等效的gcvt()方法,我怎么能用unodeode版本的sprintf()来实现呢作为参数??
请记住,我需要将特定数量的浮点字符复制到TCHAR缓冲区。
问候,
欢乐
Hello guys,
In my project gcvt() was used to convert a float value in to char value,now we are supporting unicode, hence I would like to convert float value in to wide characters.
gcvt(FloatValue, 5, CharBuffer); // was used earlier
I do not see any unicode equivalent of gcvt() method, how can I do it using unicode version of sprintf() that also takes count as argument??
Please remember, I need to copy particular number of float characters in to TCHAR buffer.
Regards,
joy
推荐答案
gcvt()
是一个旧的POSIX函数。它已从POSIX规范中删除,并且在Linux等实际POSIX系统上不再可用。从未指定过宽字符版本。建议将所有来电替换为ecvt
,fcvt
和gcvt
使用sprintf
。
相当于_stprintf
你的例子的函数调用是:
gcvt()
is an old POSIX function. It has been removed from the POSIX specification and is no longer available on actual POSIX systems like Linux. A wide character version has never been specified. It is recommended to replace all calls toecvt
,fcvt
, andgcvt
by usingsprintf
.
The equivalent_stprintf
function call for your example is:
_stprintf(CharBuffer, _T("%.5g"), FloatValue);
这是POSIX所以我认为它没有等价物。您需要使用这些功能 [ ^ ]。
That's POSIX so I don't think it has an equivalent. You need to use these functions[^].
这篇关于Unicode相当于gcvt()方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!