rusty_money
rusty_money copied to clipboard
Money library for Rust
When handling monetary amounts, the precision should be that of the minor unit instead of mathematical correct fractions. Current implementation seems to maintain the mathematical fraction ```rust let amount: Money...
Would be handy to have this FromStr impl. Usually have data from a database with currency strings and need them parsed into a Currency type. ex: ```rust let currency: &Currency...
Current implementation requires something like this: ```rust use { std::collections::HashMap, rusty_money::{Money, FormattableCurrency, iso, crypto}, }; #[derive(Debug)] struct PriceList>, } impl { fn new() -> Self { Self{ prices: HashMap::new() }...
Here is a test case that will fail (and shouldn't, unless I am missing something): #[test] fn test_rusty_money() { let eur = Money::from_str("2.00", iso::EUR).unwrap(); } Euro's are divided into 100...
Would be handy to have this FromStr impl. Usually have data from a database with currency strings and need them parsed into a Currency type. ex: ```rust let currency: &Currency...
It would be a useful abstraction to allow an unknown-currency `NaiveMoney` type that works as follows: ```rust let money: NaiveMoney = NaiveMoney::from_minor(10); let money: Money = money.with_currency(&USD); ``` - `NaiveMoney`...
Fixes #60
If you store a rate for `USD -> GBP` and then you query for the rate for `GBP -> USD`, you get a `None` value. This doesn't seem correct to...
In [iso_currencies.rs](https://docs.rs/rusty-money/0.4.1/src/rusty_money/currency/iso_currencies.rs.html#1238) the `Romanian Leu` is defined as: ```rust RON : { exponent: 2, iso_alpha_code: "RON", iso_numeric_code: "946", locale: EnEu, minor_units: 1, name: "Romanian Leu", symbol: "ر.ق", symbol_first: false, },...
`Money` has two fields, a `rust_decimal::Decimal` instance and a reference. Both implement `Copy`, so `Money` should be able to derive `Copy`. The [`Copy` documentation](https://doc.rust-lang.org/std/marker/trait.Copy.html#when-should-my-type-be-copy) recommends that *‘[g]enerally speaking, if your...