discount method

void discount(
  1. double percent
)

Applies a discount percentage to the reactive integer (subtracts percentage).

Example:

final price = swift(100);
price.discount(20); // price.value is now 80

Implementation

void discount(double percent) {
  value = (value * (1 - percent / 100)).round();
}