tax method

void tax(
  1. double percent
)

Applies a tax percentage to the reactive double (adds percentage).

Example:

final price = swift(100.0);
price.tax(10); // price.value is now 110.0

Implementation

void tax(double percent) {
  value = value * (1 + percent / 100);
}