Skip to main content

d2fu

Macro d2fu 

Source
macro_rules! d2fu {
    ($val:expr) => { ... };
}
Expand description

Converts a Decimal value to f64 without error checking.

This macro converts a Decimal type to an f64 floating-point value. It’s an “unchecked” version that doesn’t handle potential conversion errors.

§Parameters

  • $val - A Decimal value to be converted to f64

§Example

use rust_decimal_macros::dec;
use optionstratlib::d2fu;
let decimal_value = dec!(10.5);
let float_value = d2fu!(decimal_value);