A comprehensive model library for financial products (securities, prices, transactions, etc). Protobuf used for serialization, with language-specific implementations
//! Decimal helpers shared by the integration tests.
#![allow(dead_code)]useledger_models::fintekkers::models::util::DecimalValueProto;useledger_models::fintekkers::wrappers::models::utils::decimal::{decode_decimal, encode_decimal, parse_decimal_str};/// The `DecimalValueProto` for a decimal string such as `1.50`.
pubfndecimal(value:&str)-> DecimalValueProto{encode_decimal(&parse_decimal_str(value).unwrap_or_else(|e|panic!("{value:?}: {e}")))}/// The canonical string of a decimal, keeping its scale: `98.50` stays `98.50`.
pubtraitCanonical{fncanonical(&self)-> String;}implCanonical forDecimalValueProto{fncanonical(&self)-> String{decode_decimal(self).unwrap_or_else(|e|panic!("{self:?}: {e}")).to_canonical_string()}}