rusty_money
rusty_money copied to clipboard
to_string() returns different values according to the fact that we use from_minor or from_major
Hi, Thanks for this great library. Amazing job. I'm having trouble to print numbers. It'm getting different display depending on the constructor I used. Not sure it is intended...
#[test]
fn test_to_string_formatter() {
let sut = rusty_money::Money::from_minor(10000, rusty_money::iso::EUR);
let actual = format!("{}", sut);
assert_eq!("€100,00", actual)
} // pass
#[test]
fn test_to_string_formatter_from_major() {
let sut = rusty_money::Money::from_major(100, rusty_money::iso::EUR);
//let sut = Money::from_major(100);
let actual = format!("{}", sut);
assert_eq!("€100,00", actual)
} //fails with left: "€100.00". right: "€100"
Any idea how to prevent this?