str2float
There are 3 ways to group the number ten thousand with digit group separators:
- Space: the internationally recommended thousands separator.
- Point: the thousands separator used in many non-English speaking countries.
- Comma: the thousands separator used in most English-speaking countries.
In which, there are 2 types of decimal separators:
- Decimal point
- Decimal comma
This package will help convert float string (decimal point or decimal comma) to float!
Installation:
https://pypi.org/project/str2float/
pip install str2float
Usage:
from str2float import str2float
float = str2float(str_float)
Example:
from str2float import str2float
if __name__ == "__main__":
assert str2float("1") == 1.0
assert str2float("1.2345") == 1.2345
assert str2float("1.23") == 1.23
assert str2float("1.2") == 1.2
assert str2float("1,2345") == 1.2345
assert str2float("1,23") == 1.23
assert str2float("1,2") == 1.2
assert str2float("1234,5") == 1234.5
assert str2float("1.234,5") == 1234.5
assert str2float("1,234.5") == 1234.5
assert str2float("1,234,567.85") == 1234567.85
assert str2float("1.234.567,85") == 1234567.85
From hoangyell with love 😘
Metadata
Release files for str2float 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| str2float-0.0.9.tar.gz | 2.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| str2float-0.0.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.1 kB
Release files / str2float-0.0.9.tar.gz
| Download URL | str2float-0.0.9.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
097eee4adbbd101e45feb2675caebf995fa783d1d4c4f01e912ed2f79f050d7e
|
|
BLAKE2b-256 checksum How to use checksums |
871c3732153def4dca25a9d42df4b3c68f9620ac179bca2faa2bd553316b3381
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Release files / str2float-0.0.9-py3-none-any.whl
| Download URL | str2float-0.0.9-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6aa194116dc8c995e6740e3bd01b804fe1d1e9e3dbb11deb921d9b9cdb973eb1
|
|
BLAKE2b-256 checksum How to use checksums |
70091422e6f550147dcea8e20d3d390dd9489f13e5a33abc9692a29ede9e1560
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Security for str2float 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.