gpt4 book ai didi

C#,将整数和字符串连接成var

转载 作者:行者123 更新时间:2023-12-02 22:02:09 25 4
gpt4 key购买 nike

如何将整数和字符串连接成var?

int a; int x=2; int y=7200;
a=x*y;
var B=a+"D"; // How to concatenate this to turn it 14400D
// I need use this in the code that changes the AxisX.LabelStyle.Interval.
// We can not use string concatenation here.
chart1.ChartAreas[0].AxisX.LabelStyle.Interval=B;

最佳答案

.Interval 需要一个 double,你能不能直接将 int 转换为 double?

chart1.ChartAreas[0].AxisX.LabelStyle.Interval = Convert.toDouble(a);

关于C#,将整数和字符串连接成var,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16769577/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com