Conversions

Shadow121

Member
Messages
901
Reaction score
0
Points
16
Alright i got bored and such today in history (movie, as usual) and was plotting a point system for this person who had asked me for one.

Im going from usd to eur, yen and pound and was wondering while converting would i times say:
Code:
<?php
$giving = 372; //money i am giving to other person, getting
$fxrate = 0; //some number
$math = ($giving * $fxrate);
$rounded = round($math, 2); //x.**
echo $rounded.' Is Your new Amount Converted from usd to eur';
?>

Of course ill have each set to be snagged off a website =] was just wondering if that would be good to go or not.
 

phpasks

New Member
Messages
145
Reaction score
0
Points
0
Alright i got bored and such today in history (movie, as usual) and was plotting a point system for this person who had asked me for one.

Im going from usd to eur, yen and pound and was wondering while converting would i times say:
Code:
<?php
$giving = 372; //money i am giving to other person, getting
$fxrate = 0; //some number
$math = ($giving * $fxrate);
$rounded = round($math, 2); //x.**
echo $rounded.' Is Your new Amount Converted from usd to eur';
?>
Of course ill have each set to be snagged off a website =] was just wondering if that would be good to go or not.

giving = 372 this is dollar.

then
PHP:
<?php
$giving = 372; //money i am giving to other person, getting
$fxrate = 0; //some number
// We have taken $1 to convertor to euro or any other currency 
// Default $ compare
$dollar = 1;
$euro_rate = 0.80;
$math = ($giving * ($dollar/$euro_rate));
$rounded = round($math, 2); //x.**
echo $rounded.' Is Your new Amount Converted from usd to eur';
?>

Asif Khalyani
http://www.phpasks.com
 
Top