【发布时间】:2021-12-09 11:28:14
【问题描述】:
我有一个文本框,我需要转换我输入的值。
最后我想我需要将 Double 转换为数据。
但是有问题 示例代码:
textbox1.Text = "24.5";
double data = int.Parse(textbox1.Text);
byte[] b = BitConverter.GetBytes((data)f);
int i = BitConverter.ToInt32(b, 0);
代码是这样工作的
byte[] b = BitConverter.GetBytes(22.3f);
int i = BitConverter.ToInt32(b, 0);
如何插入字符串数据?
【问题讨论】:
标签: c# string type-conversion double