So "megabytes" appears to be the power-of-ten unit, which is generally not that helpful in practice.
≫ 6 megabytes to bytes
6 MB -> B
= 6000000 B
Assuming you're sticking with the power-of-ten unit, that means you should really grow support for the (sigh) "mebibytes" family of units; i.e., what some folks are retro-actively calling the power-of-two byte unit.
≫ 6 mebibytes to bytes
6 × mebibytes -> B
Unknown identifier: mebibytes
"M" - "Mega" is an official general purpose SI prefix approved in 1960 which always stood for a decimal multiplier. Its common usage as a binary multiplier was limited to counting units of computer memory, and is purely an approximation to allow convenient speaking of, e.g., a megabyte of RAM instead of 1.048576 megabytes of RAM. Because it reflects the natural scale of physical memory.
It is more properly referred to as "MeB" - "mebi", which became an ISO standard prefix in 2008.