I want to perform the following operation:
decimal = decimal? * float / 100
What's the most efficient way to do this?
I want 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!