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

Update parser-metric.js #1538

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open

Conversation

axyangsio
Copy link

kB vs KB
kB = 1000 bytes where KB = 1024 bytes.

kB vs KB
kB = 1000 bytes where KB = 1024 bytes.
@Mottie
Copy link
Owner

Mottie commented Apr 4, 2018

Hi @axyangsio!

First off, I don't think this change could maintain backwards compatibility.

This enhancement would require adding support for IEC binary values (kibibyte (KiB), mebibyte (MiB), gibibyte (GiB), etc) as well as the JEDEC format as you've started to add above; support for MB and GB should also be included here but I'm not sure how to do it without maintaining backwards compatibility.

I haven't tested it, but I think we could do it by adding the following:

'k|kilo'   : [ 1e3, 1e3 ],
'K|Ki|Kibi|Kilo' : [ 1024, 1024 ],
'Mi|Mebi|mebi' : [ Math.pow(1024, 2), Math.pow(1024, 2) ], // 1024^2
'Gi|Gigi|gigi' : [ Math.pow(1024, 3), Math.pow(1024, 3) ], // 1024^3

The RegLong and RegAbbr would need to be updated with these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants