pydicom.valuerep.DSfloat¶
- class pydicom.valuerep.DSfloat(val: Union[None, str, int, float, Decimal], auto_format: bool = False, validation_mode: Optional[int] = None)[source]¶
Store value for an element with VR DS as
float
.If constructed from an empty string, return the empty string, not an instance of this class.
- Parameters
- __init__(val: Union[str, int, float, Decimal], auto_format: bool = False, validation_mode: Optional[int] = None) None [source]¶
Store the original string if one given, for exact write-out of same value later.
Methods
__init__
(val[, auto_format, validation_mode])Store the original string if one given, for exact write-out of same value later.
as_integer_ratio
()Return integer ratio.
conjugate
()Return self, the complex conjugate of any float.
fromhex
()Create a floating-point number from a hexadecimal string.
hex
()Return a hexadecimal representation of a floating-point number.
is_integer
()Return True if the float is an integer.
Attributes
imag
the imaginary part of a complex number
real
the real part of a complex number
auto_format