Blyx Nest Blyx language
Registry / Library
library · v0.1.1

CashMatch

Apply posted payments and preserve customer credit separately.

Source repository · Package JSON

Use CashMatch

use vendor::cashmatch::cashmatch;

Run the example

nest demo cashmatch@0.1.1
blyxc native-run cashmatch-demo/main.blyx
Example source and expected output
use vendor::cashmatch::cashmatch;

fn main() {
    let due = 200.0;
    let payments = [125, 100];
    let result = cashmatch_apply(due, payments);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

200
0
25

Published versions

VersionPackageSource commitSHA-256
0.1.1Download ZIP64f8c0ab6786e8db5dcfd53da34f9aed3d3f74ecb75b0be5893bf0d88f2c80a5f5c43bb6d4