Blyx Nest Blyx language
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.

Source repository · Package JSON

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

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse files60f12864691a882efcf5a4520777a4b80ab9a8972e5f8da8b3da8297f37d22d799f828a205
0.1.0Download ZIP · Browse files6349f23784b3c3017eb851ba1906b4756d74689adcacd78bf0b9090e92379df27fbeb40be8