wisespace-io / binance-rs

Rust Library for the Binance API
Other
669 stars 300 forks source link

Precision is over the maximum defined for this asset. #146

Open ebadta81 opened 2 years ago

ebadta81 commented 2 years ago

Hello,

Is there an easy way, to handle f64's for account.market_buy?

I get numbers like this qty: 119.96000000000001 , so no surprise, the server gives me this error message.

As I see now, it is not possible with f64, but market_buy need f64.

I consider to make a Decimal version of your asset.rs.

wisespace-io commented 2 years ago

@ebadta81 Yes, I see the problem. In the past, I thought to use a decimal library, but I never did it. You can use https://crates.io/crates/rust_decimal ... in the future, we may integrate it to the crate