Skip to main content

to_contract_units_decimal

Function to_contract_units_decimal 

Source
pub fn to_contract_units_decimal(_symbol: &str, size: Decimal) -> Decimal
Expand description

Convert human-readable size (Decimal) to contract units (Decimal).

§Arguments

  • symbol - The trading symbol (e.g., “BTC-PERP”, “ETH-PERP”)
  • size - Human-readable size as Decimal (e.g., 1.0 BTC)

§Returns

Size in contract units as Decimal (e.g., 1.0 -> 1_000_000)