Closed jiftoo closed 1 year ago
Money::from_str only allows values that fit in a 32 bit integer to be parsed, while other methods allow for at least 64 bit integers.
Money::from_str
assert_eq!( Money::from_major(i64::MAX, iso::EUR) .amount() .to_i64() .unwrap(), i64::MAX ); assert!(Money::from_str(&i32::MAX.to_string(), iso::EUR).is_ok()); assert!(Money::from_str(&(i32::MAX as i64 + 1).to_string(), iso::EUR).is_err()); // the problem
Money::from_str
only allows values that fit in a 32 bit integer to be parsed, while other methods allow for at least 64 bit integers.