qiskit-documentation/docs/api/qiskit/0.26/qiskit.utils.apply_prefix.mdx

34 lines
821 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: apply_prefix (v0.26)
description: API reference for qiskit.utils.apply_prefix in qiskit v0.26
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.utils.apply_prefix
---
<span id="qiskit-utils-apply-prefix" />
# qiskit.utils.apply\_prefix
<Function id="qiskit.utils.apply_prefix" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.17/qiskit/utils/units.py" signature="apply_prefix(value, unit)">
Given a SI unit prefix and value, apply the prefix to convert to standard SI unit.
**Parameters**
* **value** (`float`) The number to apply prefix to.
* **unit** (`str`) String prefix.
**Return type**
`float`
**Returns**
Converted value.
**Raises**
**Exception** If the units arent recognized.
</Function>