justsomeguy Posted November 28, 2006 Share Posted November 28, 2006 Currency conversion is just multiplication. There's nothing complicated about it, the only thing is you need to know what the conversion rates are. They change daily, but not by much. The best way is probably to normalize everything to the dollar. According to Google, 1 USD is worth .51469 GBP, 1.2795 AUD, 115.49 yen, and .7597 EUR. So you would have all of your conversion factors saved in variables, and multiply the dollar amount by the selected conversion factor. Link to comment Share on other sites More sharing options...
jesh Posted November 28, 2006 Share Posted November 28, 2006 Umm, you will need a form. Have it have a dollar amount, then a <select> with things like USD to UK Pounds and UK Pounds to USD.If you expect people to return to your site regularly, or to make multiple purchases, you might consider saving the value of the selected currency type to a cookie on the users' computers. This way, once someone, say, chooses Yen, that selection choice is saved to the cookie. Then, on each page that you display prices, you could load up the value of the cookie to determine which currency to display, then adjust all of the display prices accordingly. Link to comment Share on other sites More sharing options...
newbielearner Posted November 28, 2006 Author Share Posted November 28, 2006 The following is my three step plan based on your pointers (THANKS) and my aptitude as I figure out each technique:1. Provide a currency exchange tool <as suggested by reportingsjr>. All prices indicated in S$ only.2. Display 2 prices for each item in S$ (the reference) and foreign currency (indicative estimation) <as suggested by justsomeguy>. The visitor will have to choose the foreign currency he/she prefers.3. Figure out how to read and write cookies <as suggested by Jesh>. I believe I can do step 1 now. Step 2 should be okay unless I get caught by the JS problems I'd previously encountered. Step 3 is completely new to me. In fact, I wonder if it's possible to "sniff" from the visitor's browser/XP/Domain/host (I'm clueless here) settings the local currency of the visitor and automatically set the foreign currency accordingly? That way the visitor doesn't even have to make a choice.Cheers Link to comment Share on other sites More sharing options...
reportingsjr Posted November 28, 2006 Share Posted November 28, 2006 Well, if you are using PHP it will be alot easier to read and write cookies, but you can with javascript. Just takes a it more code! Link to comment Share on other sites More sharing options...
newbielearner Posted November 30, 2006 Author Share Posted November 30, 2006 I'm trying to convert the layout tables in my site into CSS formatted lists... and I'm pulling my hair out. I've uploaded two versions of my attempts at getting it right. In both versions, the original desired Table layout is below the List based one. Also I've kept each thumbnail with its caption in the same list item since they belong together.In this first try, based on what my limited knowledge of how CSS should work, I can't get the thumbnail to go below the text caption. whether by using <br /> or by setting the IMG tag to BLOCK. Setting IMG tag to BLOCK seem to set the entire LI to Block as well.In this second try second try I followed boen_robot's hint and floated left the LI tags. It worked for Firefox 1.5 but didn't work too well for IE6. Also, I can't seem to get the captions to align center and become bold like in the Table (I can't seem to find out how I managed to turn the caption in the TABLE to bold! How silly!)Should I repost this in the CSS thread since this posting is purely CSS? Cheers. Link to comment Share on other sites More sharing options...
boen_robot Posted November 30, 2006 Share Posted November 30, 2006 Oh, yeah. My fault that I forgot to tell you. You need to "clear:both;" all elements that are inside the floated elements.What method exactly are you using in your first attempt? If all childs of the list are truly blocks, then they should be on a separate line. If it contains floats in any sort of way, the clear property is still a must. Link to comment Share on other sites More sharing options...
newbielearner Posted December 1, 2006 Author Share Posted December 1, 2006 Thanks to boen_robot, I've managed to convert my table-based layout into CSS-based list. I would not have thought about using floated LIs to get the effect. But the clear:both on elements within the LI didn't seem to have any effect, so I'd to use <br /> to separate the caption from the thumbnail.Something I learnt is that setting an element's display property to BLOCK forces it to be BLOCK at the document level. I'd thought it would only make it a BLOCK element WITHIN its parent element. Please correct me if I'm wrong. I tried to use inline-block to no avail. I'm still pretty confused over how to render table-based layout using CSS-based list. eg. how does one achieve the vertical alignment of table cells with variable length content? Let's say each Item comprises a Text Title, a thumbnail and a description. Using tables, I would use one TD for the Text Title, one TD on another TR for the thumbnail, and one TD on yet another TR for the description. All the rows would be nicely aligned vertically even if their content heights are different. How do I do that using CSS-based lists? as an example of what I'm describing see the second table on this page.Cheers. Link to comment Share on other sites More sharing options...
boen_robot Posted December 1, 2006 Share Posted December 1, 2006 I guess the "li"s will have to be turned to "inline" and then be "vertical-align"ed. Or something like that...Make your list have the same contents as the table while still using your successfull method, so that the problem is seen in action . Link to comment Share on other sites More sharing options...
Sniffy Posted December 24, 2006 Share Posted December 24, 2006 Nice site,I viewed it in IE and it was perfect.The quick-loading and neutral layout really goes will with what you're selling.Keep it up. Link to comment Share on other sites More sharing options...
lilyofthevalley Posted January 5, 2007 Share Posted January 5, 2007 Don't forget--it's 2007. Update your copyright on this site.There is a very clean and light look to your site--good design choices given the focus. Link to comment Share on other sites More sharing options...
newbielearner Posted January 10, 2007 Author Share Posted January 10, 2007 Thank you Sniffy and lilyofthevalley for your encouraging remarks. I will update the copyright to 2007 NOW!Here's wishing all of w3schools forummers a wonderful year ahead! Link to comment Share on other sites More sharing options...
Kristian_C Posted January 10, 2007 Share Posted January 10, 2007 I remember when i first try to make a site, and every simple one in the forum screamed palette palette all day and all night, seems like you got the palette thing right.Im shure that you have updated the site alot here now, before i got to answer and i think its a verry nice site -> Kristian_C Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now