转换数据类型的代码 [英] The code to convert datatype
本文介绍了转换数据类型的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将float数据类型转换为字符串数据类型
[edit]请勿使用大写字母[/edit]
How to convert float datatype to string datatype
[edit]Please do not use UPPER CHAR[/edit]
推荐答案
就像这样:
Like this:
float foo = 32.2;
string bar = foo.ToString();
您可能想看看此链接 [
You might want to take a look at this link[^] it helps you specifiy how you want the string to be formatted (decimal points, separators etc).
您也可以尝试
string u = Convert.ToString(foo);
You can also try
string u = Convert.ToString(foo);
float aa = 1000;
string bb = aa.ToString();
这会有所帮助
this will help
这篇关于转换数据类型的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文