Need help converting the result to a decimal.
I need to determine 20% of a dollar amount so that I can compare it to another amount to find the larger of the two. Easy stuff but I am struggling with getting the result to a decimal format.
I have so far…
double foo = (.20 / 100) * 326.23;
the above expression gives me 0.65246
but what I need is the dollar amount or decimal 65.246 .
whats the next step?
Two things; one as another answer says you just multiple by .2. The second is that for monetary amounts you should use the actual type
decimal, notdouble, as you’ll never be able to get exact amounts out ofdouble.