My goal is to input the amount of Bytes used by a user as $inputbox and
calculate how many kbs,megs,gigs along with $cost for the price per meg.
?
$inputbox = 414478244;
// PROCESS DATA
$kbs = $inputbox/1024;
$megs = $kbs/1024;
$gigs = $megs/1024;
// CALC COST OF MEGS
cost = $megs * 0.05;
Philip J. Newman wrote:
My goal is to input the amount of Bytes used by a user as $inputbox and
calculate how many kbs,megs,gigs along with $cost for the price per meg.
snip
Questions?
1. Should I be dividing by 1024 or 1000? This was passed to me by word of
mouth ...
2. Any way of rounding to 2
* Thus wrote Philip J. Newman ([EMAIL PROTECTED]):
My goal is to input the amount of Bytes used by a user as $inputbox and
calculate how many kbs,megs,gigs along with $cost for the price per meg.
?
$inputbox = 414478244;
// PROCESS DATA
$kbs = $inputbox/1024;
$megs = $kbs/1024;
* Thus wrote Matthew A. Blasinski ([EMAIL PROTECTED]):
Philip J. Newman wrote:
My goal is to input the amount of Bytes used by a user as $inputbox and
calculate how many kbs,megs,gigs along with $cost for the price per meg.
[...]
3) Use a search and replace (regular expression) to replace
Thanks, that seems to work very well (o;
/ Josh
- Original Message -
From: Curt Zirzow [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Sunday, July 27, 2003 10:17 AM
Subject: Re: [PHP] Changing Bytes to KB, to megs, to gigs.
* Thus wrote Matthew A. Blasinski ([EMAIL PROTECTED]):
5 matches
Mail list logo