By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,230 Members | 1,327 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,230 IT Pros & Developers. It's quick & easy.

numeric function

P: n/a
Hi all,

Please, can somebody help me to understand how calculate this number in
php?

I've got 4.7554844644e+06 and I need to have 4.7Mbits
Is there a php function can helps me?

Really thanx
Cheers
DP.

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
*** Davide wrote/escribió (23 May 2005 02:46:16 -0700):
I've got 4.7554844644e+06 and I need to have 4.7Mbits
Is there a php function can helps me?


1 byte = 8 bits
1024 bytes = 1 kilobyte (or KB)
1024 kilobytes = 1 megabyte (or MB)

You need to convert from an unknown unit to megabits. Let's suppose the
unknown unit is bits:

$result= 4.7554844644e+06 / (1024*1024);

If they aren't bits, do the math accordingly.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.