Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ] Helper function that converts human readable string like 1.5G to bytes (integer form string). #16

Open
soyfrien opened this issue May 16, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@soyfrien
Copy link
Owner

Is your feature request related to a problem? Please describe.
This is about #15, which I've decided is not a bug.

A helper function that converts swap_size to bytes from a human readable string is required.

Strings can occur with or without decimals, in upper or lower case. Always rounding down, example strings and conversions might be:

swap_size 𝑓(swap_size) multiplier pattern
1234567890 1234567890 10240
1234567890.9 1234567890 10240
1205632.70k 1234567884 10241
1177.375M 1234567168 10242
1.14978G 1234566874 10243

The conversion can be a string in integer form.

Describe the solution you'd like
Perhaps a function that takes a string as an argument and returns a converted string.

Describe alternatives you've considered
I am mostly just curious to see how the help wanted tag works.

@soyfrien soyfrien added enhancement New feature or request help wanted Extra attention is needed labels May 16, 2022
@soyfrien soyfrien changed the title [REQ] Helper function that converts swap_size to bytes from a human readable string is required. [REQ] Helper function that converts from a human readable string like 1.5G to bytes (integer form string). May 16, 2022
@soyfrien soyfrien changed the title [REQ] Helper function that converts from a human readable string like 1.5G to bytes (integer form string). [REQ] Helper function that converts human readable string like 1.5G to bytes (integer form string). May 16, 2022
soyfrien added a commit that referenced this issue May 16, 2022
A user solving #16 can add their code on line 36.
soyfrien added a commit that referenced this issue May 16, 2022
soyfrien added a commit that referenced this issue May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant