Implementing User-Defined Casts实
2019-02-14 本文已影响0人
津涵
Currency.cs
1.png
Main.cs
2.png
Tips
(1)尽量不损失精度的高级用法:Convert.ToUInt16
The System.Convert object contains a large number of static methods to perform various numerical conversions, and the one that we want is Convert.ToUInt16. Note that the extra care taken by the System.Convert methods comes at a performance cost. You should use them only when necessary.
但会损失一些效率