pub fn decimal_to_quotation(value: Decimal) -> Result<Quotation, MoneyError>Expand description
Builds a Quotation from a number.
Use it for the price of an order request. This function does not round to the instrument price
step: round with the library first (Price::round_to_step).
§Errors
As decimal_to_parts.
§Examples
use rust_decimal::Decimal;
use brokapi_tbank_protocol::money::decimal_to_quotation;
let q = decimal_to_quotation(Decimal::new(27345, 2))?;
assert_eq!((q.units, q.nano), (273, 450_000_000));