Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 如何在 C# 中将 System.Decimal 位转换为字符串?
我从 decimal.GetBits() 得到 int[]。如何从 int[] 取回十进制值?
使用Decimal(Int32[] bits)构造函数。像这样:
Decimal(Int32[] bits)
Decimal d = new Decimal( 123 ); Int32[] bits = d.GetBits(); Decimal e = new Decimal( bits ); Debug.Assert( d == e );
它可以像这样转换回来:
var decimal = new Decimal(decimalBitArray)
请参阅MSDN 十进制
decimal dec = new decimal(decimalArray);