Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/randomggames/engineeringnotation
https://github.com/randomggames/engineeringnotation
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/randomggames/engineeringnotation
- Owner: RandomGgames
- Created: 2023-12-12T21:18:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-07T21:41:37.000Z (11 months ago)
- Last Synced: 2024-10-14T06:35:56.052Z (2 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Engineering Notation
This Python class provides functionality to convert numeric values into engineering notation. Engineering notation is a way of representing numbers in scientific notation but the exponent is a power of 3, allowing numbers to be directly read as SI units.
## Example usage
```py
from EngineeringNotation import EngineeringNotation# Example usage
value = 12345678.9
eng_notation = EngineeringNotation(value)# Get the value in standard SI form (with metric prefix)
si_form = eng_notation.get_si_form()
print(si_form) # Prints: 12.35 M as in Mega# Get the value in engineering form (with exponent)
eng_form = eng_notation.get_engieering_form()
print(eng_form) # Prints: 12.35E6 as in 12.35*10^6
```