Closed as not planned
Description
Feature Request: Financial Calculations Module
Summary
Add a comprehensive financial calculations module to the Rust standard library to support common financial operations and calculations.
Motivation
Financial calculations are a common requirement in many applications, from personal finance tools to enterprise banking systems. Having standardized, well-tested financial calculation utilities in the standard library would:
- Ensure consistency and accuracy in financial computations
- Reduce the need for external dependencies
- Provide a reliable foundation for financial applications written in Rust
Proposed Implementation
Add a new module std::finance
(or similar) that includes:
Core Financial Functions
- Present Value (PV)
- Future Value (FV)
- Net Present Value (NPV)
- Internal Rate of Return (IRR)
- Compound Interest calculations
- Amortization schedules
Money Type
- A decimal-based Money type that handles currency calculations without floating-point errors
- Support for different currency representations
- Basic arithmetic operations with proper rounding
Additional Features
- Interest rate conversions (APR to APY, etc.)
- Payment calculations (PMT)
- Loan amortization utilities
- Basic investment portfolio calculations
Benefits
- Improves financial accuracy in Rust applications
- Reduces duplication of effort across projects
- Provides a standard way to handle common financial calculations
- Enhances Rust's appeal for financial software development
Questions
- Should this be part of std or a separate crate in the rust-lang organization?
- What should be the minimum set of financial functions to include?
- How should we handle different currency formats and conversions?
- What precision guarantees should we provide?
Next Steps
- Gather feedback from the community on the scope
- Create detailed specifications for each proposed function
- Implement proof-of-concept with comprehensive test cases
- Document all functions with clear examples and use cases
Metadata
Metadata
Assignees
Labels
No labels