Skip to content

parseByteSize ​

Import from: @xbbg/xnews, @xbbg/xnews/parsers

parseByteSize(value): number

Defined in: src/text.ts (declaration: text.d.ts:37)

"1005 Kb", "1.4 MB", "1 005 KiB", "512 bytes" to a byte count.

Units are read as binary regardless of how they are spelled: catalogs label 1024-byte kilobytes kB as often as KiB, so honouring the SI spelling would misreport most sizes by 2.4%.

Parameters ​

value ​

string

Returns ​

number

Last updated:

xbbg is independent open-source software and is not affiliated with, endorsed by, sponsored by, or approved by Bloomberg Finance L.P.