diff --git a/WDL/Value.py b/WDL/Value.py index aadbef58..8fa763ed 100644 --- a/WDL/Value.py +++ b/WDL/Value.py @@ -120,7 +120,8 @@ def __init__(self, value: float, expr: "Optional[Expr.Base]" = None) -> None: super().__init__(Type.Float(), value, expr) def __str__(self) -> str: - return "{:.6f}".format(self.value) + # converting to string using repr to retain the float value as is and eliminating rounding. + return repr(self.value) class Int(Base): @@ -549,6 +550,8 @@ def from_json(type: Type.Base, value: Any) -> Base: return Int(value) if isinstance(type, (Type.Float, Type.Any)) and isinstance(value, (float, int)): return Float(float(value)) + if isinstance(type, (Type.Float, Type.Any)) and "e" in value.lower(): + return Float(float(value)) if isinstance(type, Type.File) and isinstance(value, str): return File(value) if isinstance(type, Type.Directory) and isinstance(value, str):