Double to String无法正常工作 [英] Double to String not working

查看:65
本文介绍了Double to String无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将双精度转换为字符串而无法使其工作。我已经尝试过Convert.ToString(...)和其他一些排列(System :: Convert.ToString(...)等),但没有任何效果。出于某种原因,我一直认为转换不是System命名空间的一部分。基本上,编译器无法将ToString()识别为可用函数。什么'出错了?

I''m trying to convert a double to a string and can''t get it to work. I''ve tried Convert.ToString(...) and a few other permutations (System::Convert.ToString(...), etc), but nothing works. For some reason I keep getting back that Convert is not a part of the System namespace. Basically, the compiler can''t recognize ToString() as a usable function. Any ideas on what''s going wrong?

推荐答案

如果您使用的是c ++,可以使用sprintf()
If you are using c++ you can use sprintf()


是的那样做。


我试过sprintf(),我的双打正在被舍入。我会回去看看那里出了什么问题。


关于为什么转换和ToString不起作用的任何输入?
I''ve tried sprintf() and my doubles are being rounded. I''ll go back and see what''s going wrong there.

Any input on why Convert and ToString isn''t working?


这篇关于Double to String无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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