pub fn truncate_to_string(value: Decimal, precision: i32) -> StringExpand description
Truncates a decimal to the specified number of decimal places without rounding.
ยงExamples
use ccxt_core::precision::truncate_to_string;
use rust_decimal::Decimal;
use std::str::FromStr;
let num = Decimal::from_str("123.456789").unwrap();
assert_eq!(truncate_to_string(num, 2), "123.45");
assert_eq!(truncate_to_string(num, 4), "123.4567");
assert_eq!(truncate_to_string(num, 0), "123");