Hey guys. Rust newbie here. I am trying to calculate amount deducted from a value based on rate and decimal places in rate.
Without the decimal places, suppose if I want to deduct 2% amount from original (where 2 is the rate), this is how I am accomplishing it:
let original = token_value[0].amount;
token_value[0].amount = original * Decimal::percent(98);
What if I want to also define the decimal places in rate and then make the deduction, how will I accomplish that?