Unicode相当于gcvt()方法 [英] Unicode equivalent of gcvt() method

查看:109
本文介绍了Unicode相当于gcvt()方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



在我的项目中,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 to ecvt, fcvt, and gcvt by using sprintf.

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屋!

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