| Crates.io | br_financial |
| lib.rs | br_financial |
| version | 0.4.0 |
| created_at | 2025-11-28 15:52:34.349296+00 |
| updated_at | 2025-11-28 22:31:57.042609+00 |
| description | It's a lib to export calc of financing real state |
| homepage | |
| repository | https://github.com/ofabianomartins/br_financing |
| max_upload_size | |
| id | 1955520 |
| size | 38,270 |
A library to calculate real estate financing in Brazil.
This library provides tools to calculate the installments of real estate financing using the two main amortization systems in Brazil: SAC (Sistema de Amortização Constante) and Price (Sistema Francês de Amortização).
Add this to your Cargo.toml:
[dependencies]
br_financial = "0.1.0"
And then in your code:
// Example usage will be added here.
// For now, please refer to the documentation on docs.rs.
fn main() {
let input = DebtCalculationInput {
total_amount: dec!(360_000),
interest_per_year: dec!(10.5),
down_payment_percent: dec!(5),
total_months: 420,
};
match calculate_debt_trajectory(input) {
Ok(result) => {
println!("SAC First Payment: {:.2}", result.sac_table.first_payment);
println!("SAC Last Payment: {:.2}", result.sac_table.last_payment);
println!("SAC Total Paid: {:.2}", result.sac_table.total_paid);
println!("Price Fixed Payment: {:.2}", result.price_table.fixed_payment);
println!("Price Total Paid: {:.2}", result.price_table.total_paid);
}
Err(e) => {
eprintln!("Error calculating debt trajectory: {}", e);
}
}
}
This project is licensed under the MIT License - see the LICENSE.md file for details.
Contributions are welcome! Please feel free to submit a pull request.