Hi friends i am working for an shopping cart using php script, i placed a drop down option to display currency rate as per user selection(INR and USD). By default it will display all the price in INR, if any user select USD, then it has to show all the values in USD.I dont know how to display the USD live rates. can any one please help to resove the issue.

Member Avatar
Member Avatar
+0 forum 8

Hi - I am having an issue and can't seem to get my head around it. I am trying to calculate GBP from EUR - which should be easy but for some reason my returned value is always a few GBP more than it should be, yet I do the same calculation on my calculator or Google and it's right. Can anyone see what I am doing wrong? I have this: $rate = 1.20881; //var_dump shows float, tried different combos too $euro = 74; //var_dump shows float $gbp = ($euro / $rate); //should give me 61.21 but it keeps giving …

Member Avatar
Member Avatar
+0 forum 2

Hi I'm having an issue echo out the `euro currency` sign with the price converted base on the `$exchange_rate = 0.7746;` Here is my code: <?php $currency = true; $format = '&euro; %2f'; $exchange_rate = 0.7746; function currency_valve($data) { $price = $data[1]; $cpercent = $data[2]; $cvalve = isset ($_GLOBALS['currency']) && $_GLOBALS['currency']; $amount = ($cvalve ) ? $price * (1 + $cpercent / 100) : $price; return sprintf($GLOBALS['format'], $amount / $GLOBALS['exchange_rate']); } $data = "This Mango Cheesecake costs {amount: 11.95} "."and the Raspberry Cheesecake costs {amount: 13.95}.\n"; echo preg_replace_callback ('/\{amount\:\ ([0-9.]+)\ \%([0-9.]+)\%\}/','currency_valve',$data); ?> When I echo it: `This Mango Cheesecake costs …

Member Avatar
Member Avatar
+0 forum 17

Hello Dani Web Forum, I'm really new to C. I have an assignment, which I think it's very hard to solve. I have to create a Currency Converter Program that reads data from txt files. The program should also be able to read arguments (argv[]). I'm really confused since it's just a plain text. How can I read it as a database in C? The data, which on the "currency.txt" saved with: [CODE] typedef struct{ char date[11]; char curr[10]; double buying; double selling; }CURRENCY; [/CODE] contains: -------------------------------------------------- DATE | currency | buying rate | selling rate *not stated in "currency.txt" …

Member Avatar
Member Avatar
+0 forum 7

Im trying to make a fast food program on which the user will input the amount that he has, then he will click on what he wants, by using check boxes. There are 7 different check boxes with 7 different amounts of money. I got an idea on what to do (they will check on what they want and the program will add up the total and there is only one of each item), but im confused on how to put the amount on where the check boxes (in the program area and not the text area) and add them …

Member Avatar
Member Avatar
+0 forum 5

Hi All, I am trying to program a web based cash register/POS application. I would like to use a function to format the number in the "Amount Received" text box. The idea I have in mind is to always keep two decimal places at all times. For Example: if someone typed in 2000 it would automatically change that to 20.00 I would probably be triggering the function via onkeyup so it would actually change it on number at a time. 2->.02, 20->.20, 200->2.00, 2000->20.00 ect. I know I could do it in php when processing the form, but I would …

Member Avatar
Member Avatar
+0 forum 11

Hi, I am a total newbie to programming, so I do not know much about it. However I have created this very basic program which converts 2 currencies. I would appreciate it if I received some constructive criticism so I can improve my programming skills. Thanks, xka [CODE] #include <iostream> #include <cstdlib> #include <cmath> #include <windows.h> int yGB(); int gbY(); using namespace std; int main() { int opChoice; cout << "Welcome to the currency converter \n\n\n"; Sleep(1000); starto: cout << "1. British sterling to Japanese Yen. \n"; cout << "2. Japanese Yen to British sterling. \n"; cin >> opChoice; switch(opChoice) …

Member Avatar
Member Avatar
+0 forum 7

The End.