C#: Multiply Decimal with Float?
I want开发者_如何学C to perform the following operation:
decimal = decimal? * float / 100
What's the most efficient way to do this?
Do you want the result as a float
var result = ((float)d) * f / 100;
or as a decimal
var result = d * ((decimal)f) / 100;
I certainly question the mixing of decimal and float types though. Some context would help!
加载中,请稍侯......
精彩评论