Skip to main content

decimal_from_f64

Function decimal_from_f64 

Source
pub fn decimal_from_f64(v: f64) -> Result<Decimal, String>
Expand description

Convert f64 to Decimal with 6 decimal places precision.

Returns an error message if the value is NaN, infinite, or cannot be represented as a Decimal.