Skip to main content

split_bill_paisa

Function split_bill_paisa 

Source
pub fn split_bill_paisa(total_paisa: i64, count: usize) -> Vec<i64>
Expand description

Splits total_paisa across count people so the parts sum EXACTLY to total. Port of lib/core/bill_splitter.dart splitBillPaisa. div_euclid/rem_euclid match Dart ~//% on non-negative totals; on negatives Rust keeps the exact sum where Dart drifts (improvement, real inputs are non-negative). Counts past 10k return empty (FFI OOM guard).