UCE Docs / DValue::to_f64

Signature

f64 DValue::to_f64(f64 default_value = 0) const

Parameters

f64 : fallback returned when conversion is not possible
return value : converted value or the fallback

Converts strings, f64, bool, pointer, and single-value maps to a finite double. Invalid or empty strings return the default.

Example

DValue value;
value = "12.5";
print(value.to_f64(), "\n");
Output
12.5