computeTaxAmount method
Decimal
computeTaxAmount(
- Decimal grossPnl
Implementation
Decimal computeTaxAmount(Decimal grossPnl) {
if (grossPnl > Decimal.zero &&
state.taxRate != null &&
state.taxRate! > 0) {
final taxPercentage = state.taxRate! / 100;
return grossPnl * MatexDecimal.fromDouble(taxPercentage);
}
return Decimal.zero;
}