Topic awaiting preservation: php calculation & notation question (Page 1 of 1) |
|
---|---|
Neurotic (0) Inmate Newly admitted From: |
posted 11-10-2009 18:05
Dear fellow inmates code: <?php $sqm = '230'; echo "$sqm m² / "; print round($sqm * 10.764); echo " sq ft";?> |
Maniac (V) Mad Scientist From: Denver, CO, USA |
posted 11-10-2009 20:38
code: <?php echo "$sqm m² / " . round($sqm * 10.764) . " sq ft"; ?>
|
Obsessive-Compulsive (I) Inmate From: |
posted 11-10-2009 22:15
Thank you twItch^! code: <?php $sqm = '6666'; echo number_format($sqm, 0, ',', '\'') . " m² / " . number_format(($sqm * 10.764), 0, ',', '\,') . " sq ft"; ?>
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 11-11-2009 08:19
of course there is, |
Obsessive-Compulsive (I) Inmate From: |
posted 11-19-2009 12:46
Thanks Tyberius! code: <?php function calcsqft($sqm){ $sqft=number_format(($sqm * 10.764), 0, ',', '\,'); return $sqft; } ?>
code: <?php echo calcsqft(400) . " sq ft" ?>
code: <?php echo calcsqft(400) ?>
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 11-19-2009 17:54
return $sqft; |
Obsessive-Compulsive (I) Inmate From: |
posted 11-20-2009 19:13
Thanks Tyberius! I didn't think it would be that simple. code: <?php function sqft($sqm){ $ft=number_format(($sqm * 10.764), 0, ',', '\,'); return number_format($sqm, 0, ',', '\'') . " m² / " . $ft . " sq ft"; } ?>
code: <?php echo sqft(2700);?>
|