use*_*202 -2 .net c# numericupdown
在 C# 中,我有一个代表浮点值的NumericUpDown控件,例如 2.3。它可以从用户界面增加或减少 0.1。
但是,该值无法以编程方式写入或读取,因为它是 C# 中的 int。我需要能够读取和写入这个浮点(或双精度)值。
目前,编译器强制我将其转换为 int 并删除小数位。这显然是 C# 中的一个错误。
嗯,上次我检查属性时是NumericUpDown.Value小数......
decimal d = NumericUpDown.Value;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13685 次 |
| 最近记录: |