Registry / Library

library · v0.1.1
Cart Discount
Calculate a minor-unit discount capped by both an offer maximum and the subtotal. Rates are whole basis points rounded down.
Use Cart Discount
use vendor::cart_discount::cart_discount;
Run the example
nest demo cart_discount@0.1.1
blyxc native-run cart_discount-demo/main.blyx
Example source and expected output
use vendor::cart_discount::cart_discount;
fn main() {
println!(cart_discount(999,1000,500));
}
Expected output
99
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.1 | Download ZIP · Browse files | 60f1286469 | 1a882efcf5a4520777a4b80ab9a8972e5f8da8b3da8297f37d22d799f828a205 |
| 0.1.0 | Download ZIP · Browse files | 6349f23784 | b3c3017eb851ba1906b4756d74689adcacd78bf0b9090e92379df27fbeb40be8 |