pub fn truncate(value: Decimal, precision: i32) -> DecimalExpand description
Truncates a decimal to the specified number of decimal places, returning a Decimal.
ยงExamples
use ccxt_core::precision::truncate;
use rust_decimal::Decimal;
use std::str::FromStr;
let num = Decimal::from_str("123.456789").unwrap();
let truncated = truncate(num, 2);
assert_eq!(truncated.to_string(), "123.45");