diff -rupN multicurrency/uc_multicurrency.module multicurrency_new/uc_multicurrency.module
--- multicurrency/uc_multicurrency.module	2009-07-01 10:42:57.000000000 +1000
+++ uc_multicurrency.module	2010-03-22 15:56:33.000000000 +1100
@@ -650,12 +650,21 @@ function uc_multicurrency_block($op = 'l
   switch ($op) {
     case 'list':
       $blocks[0]['info'] = t('Country Selection');
+      $blocks[1]['info'] = t('Currency Selection');
       return $blocks;
 
     case 'view':
-      $block['subject'] = t('Country Selection');
-      $block['content'] = drupal_get_form('uc_multicurrency_country_select_form');
-      return $block;
+      switch ($delta) {
+        case 0:
+          $block['subject'] = t('Country Selection');
+          $block['content'] = drupal_get_form('uc_multicurrency_country_select_form');
+          return $block;
+        case 1:
+          global $user;
+          $block['subject'] = t('Currency Selection');
+          $block['content'] = drupal_get_form('uc_multicurrency_currency_select_form');
+          return $block;
+      }
   }
 }
 
@@ -680,6 +689,7 @@ function uc_multicurrency_country_select
 }
 
 
+
 /**
  * Submit handler for country selection form
  */
@@ -689,6 +699,50 @@ function uc_multicurrency_country_select
 }
 
 
+/**
+ * Currency selection form
+ */
+function uc_multicurrency_currency_select_form(&$form_state) {
+  global $user;
+
+  // Define submit handler function
+  $form['#submit'][] = 'uc_multicurrency_currency_select_form_submit';
+
+  // Get the currently selected currency based on user preference or session variable (or use the default)
+  if ($user->uid > 0 && isset($user->currency_code)) {
+    $current_selection = $user->currency_code;
+  }
+  elseif (isset($_SESSION['uc_currency_code'])) {
+    $current_selection = $_SESSION['uc_currency_code'];
+  }
+  else {
+    $current_selection = variable_get('uc_currency_code', 'USD');
+  }
+
+  $form['currency_selection'] = array(
+    '#type'     => 'select',
+    '#default_value' => $current_selection,
+    '#options'  => _uc_multicurrency_currencies_in_use(),
+  );
+  $form['select_button'] = array(
+    '#type'     => 'submit',
+    '#value'    => t('Apply'),
+  );
+
+  return $form;
+}
+
+
+
+/**
+ * Submit handler for country selection form
+ */
+function uc_multicurrency_currency_select_form_submit($form, &$form_state) {
+  $result =  uc_multicurrency_get_country_from_currency($form_state['values']['currency_selection']);
+  uc_multicurrency_set_currency($result['country'], $result['currency']);
+}
+
+
 /******************************************************************************
  * Ubercart Hooks                                                             *
  ******************************************************************************/
@@ -808,6 +862,41 @@ function uc_multicurrency_get_country()
 
 
 /**
+ * Get a country based on a currency code
+ *
+ * @param $currency
+ *   The three-letter currency code
+ *
+ * @return array containing the country and currency
+ */
+function uc_multicurrency_get_country_from_currency($currency) {
+  $variable = db_result(db_query("SELECT name FROM {variable} WHERE name LIKE 'uc_multicurrency_country_currency_%' AND value LIKE '%".$currency."%'"));
+  $iso2 = substr($variable, -2);
+  $country = uc_get_country_data(array('country_iso_code_2' => $iso2));
+  $result = db_result(db_query("SELECT country_iso_code_2 FROM {uc_countries} WHERE country_id = %d", $country[0]['country_id']));
+  return array('country' => $result, 'currency' => $currency);
+}
+
+
+/**
+ * Get the currency code from the $user object.  Returns default country
+ * if no currency set in $user object.
+ *
+ * @return
+ *   ISO 3166 2-character country code
+ */
+function uc_multicurrency_get_currency($user) {
+  if (isset($user->currency_code)) {
+    $currency = $user->currency_code;
+  }
+  else {
+    $currency = variable_get('uc_currency_code', 'USD');
+  }
+  return $currency;
+}
+
+
+/**
  * Sets the country code in the $user object.
  *
  * Works only for logged-in users.
@@ -819,12 +908,32 @@ function uc_multicurrency_set_country($c
   global $user;
 
   if ($user->uid) {  // Only for logged-in users
+    unset($user->currency_code);
     user_save($user, array('country_iso_code_2' => $country));
   }
 }
 
 
 /**
+ * Sets the currency code in the $user object and in the $_SESSION variable
+ *
+ * @param $country
+ *   ISO 3166 2-character country code
+ * @param $currency
+ *   A 3-letter currency code
+ */
+function uc_multicurrency_set_currency($country, $currency) {
+  global $user;
+
+  if ($user->uid) {  // Only for logged-in users
+    user_save($user, array('country_iso_code_2' => $country));
+    user_save($user, array('currency_code' => $currency));
+  }
+  $_SESSION['uc_currency_code'] = $currency;
+}
+
+
+/**
  * Convenience method to return just one element of the conversion array
  *
  * @param $from
@@ -906,65 +1015,75 @@ function uc_multicurrency_get_multiplier
 }
 
 
+
 /**
- * Format an amount for display with the store's currency settings.
- *
- * This is a modified version of the core Ubercart function uc_currency_format()
- * The core function must be renamed so that this one can be used.
+ * Implementation of hook_uc_price_handler().
  */
-function uc_currency_format($value, $sign = TRUE, $thou = TRUE, $dec = NULL, $currency_code = NULL) {
+function uc_multicurrency_uc_price_handler() {
+  return array(
+    'alter' => array(
+      'title' => t('Multicurrency price handler'),
+      'description' => t('Alter the price for a given currency in multicurrency setups.'),
+      'callback' => 'uc_multicurrency_price_handler_alter',
+    ),
+    'format' => array(
+      'title' => t('Multicurrency price handler'),
+      'description' => t('Format the price based on the user currency settings.'),
+      'callback' => 'uc_multicurrency_price_handler_format',
+    ),
+  );
+}
 
+/**
+ * Default price handler alterer; adds the default prefixes to the various
+ *   product prices when viewing a product node.
+ */
+function uc_multicurrency_price_handler_alter(&$price, &$context, &$options) {
   global $user;
 
-  // Decide how to format prices for anonymous users
-  if (!$user->uid) {  // Anonymous
-    if (variable_get('uc_multicurrency_anonymous_behavior', 0)) {
-      return variable_get('uc_multicurrency_price_message',
-                          t('Please log in to see prices'));
-    }
-  }
-
   // Get the chosen currency for this country
   $default_currency = variable_get('uc_currency_code', 'USD');
-  if (!empty($currency_code)) {
+
+  // If the user has a set currency code, use that first
+  if (!empty($user->currency_code)) {
+    $options['currency'] = $user->currency_code;
+  }
+  // Or we can use it from the session, if it exists
+  else if (isset($_SESSION['uc_currency_code'])) {
+    $options['currency'] = $_SESSION['uc_currency_code'];
+  }
+  elseif (!empty($options['currency_code'])) {
     // Argument passed in - use it!
-    $currency = $currency_code;
+    $currency = $options['currency_code'];
   }
   else {
     // No argument passed in, figure out what currency to use
 
     // Get the country to use
     if (!$user->uid) { // Anonymous
-      $country = variable_get('uc_multicurrency_default_country', 'US');
+      $options['country'] = variable_get('uc_multicurrency_default_country', 'US');
     }
     else {
-      $country  = uc_multicurrency_get_country();
+      $options['country'] = uc_multicurrency_get_country();
     }
-    $currency = variable_get('uc_multicurrency_country_currency_'. $country, $default_currency);
+    $options['currency'] = variable_get('uc_multicurrency_country_currency_'. $options['country'], $default_currency);
   }
 
-  // Get the currency symbol for this currency
-  $symbol = variable_get('uc_currency_symbol_'. $currency,
-                         variable_get('uc_currency_sign', '$'));
-
   // Get the conversion factor for the chosen currency
-  $factor = (float) uc_multicurrency_get_factor($default_currency, $currency);
+  $factor = (float) uc_multicurrency_get_factor($default_currency, $options['currency']);
 
   // Get the multiplier for the chosen currency
-  $multiplier = (float) uc_multicurrency_get_multiplier($currency);
+  $multiplier = (float) uc_multicurrency_get_multiplier($options['currency']);
 
   // Change the price according to the conversion factor and the
   // multiplier for the chosen currency.
-  $value = (float) $value * $multiplier * $factor;
-
-  // Set decimal value to $fraction if rounding
-  $fraction = (float) variable_get('uc_multicurrency_decimal_value', 0);
+  $price['price'] = (float) $price['price'] * $multiplier * $factor;
 
   // Perform rounding if desired.
   // NEVER ROUND FOR DEFAULT CURRENCY!  NEVER ROUND ZERO VALUES!
   // If decimal value is left blank AND rounding is enabled, suppress
   // display of decimal fraction
-  if ($country != variable_get('uc_multicurrency_default_country', 'US') && $value != 0) {
+  if ($options['country'] != variable_get('uc_multicurrency_default_country', 'US') && $price['price'] != 0) {
     $suppress = FALSE;
     switch (variable_get('uc_multicurrency_rounding', 0)) {
       default:
@@ -975,47 +1094,63 @@ function uc_currency_format($value, $sig
       case 1:
         // Round UP
         if ($fraction=='') $suppress = TRUE;
-        $value = (float) ceil($value) + $fraction / 100.0;
+        $price['price'] = (float) ceil($price['price']) + $fraction / 100.0;
         break;
 
       case 2:
         // Round DOWN
         if ($fraction=='') $suppress = TRUE;
-        $value = (float) floor($value) + $fraction / 100.0;
+        $price['price'] = (float) floor($price['price']) + $fraction / 100.0;
         break;
     }
   }
 
-  $default_sign_after = variable_get('uc_sign_after_amount', FALSE);
-  $default_thou       = variable_get('uc_currency_thou', ',');
-  $default_dec        = variable_get('uc_currency_dec', '.');
-  $default_prec       = variable_get('uc_currency_prec', 2);
-
-  if (variable_get('uc_currency_prec_'. $currency, $default_prec) > 0) {
-    if (abs($value) < '.'. str_repeat('0', variable_get('uc_currency_prec_'. $currency, $default_prec) - 1) .'1') {
-      $value = 0;
+  // Set decimal value to $fraction if rounding
+  $fraction = (float) variable_get('uc_multicurrency_decimal_value', 0);
+
+  // If the value is less than the minimum precision, zero it.
+  if ($options['prec'] > 0 && abs($price['price']) < 1 / pow(10, $options['prec'])) {
+    $price['price'] = 0;
+  }
+}
+
+/**
+ * Default price handler formatter; formats the price using the store currency
+ *   display settings.
+ */
+function uc_multicurrency_price_handler_format($price, $options) {
+  $output = '';
+  global $user;
+
+  // Decide how to format prices for anonymous users
+  if (!$user->uid) {  // Anonymous
+    if (variable_get('uc_multicurrency_anonymous_behavior', 0)) {
+      return variable_get('uc_multicurrency_price_message',
+                          t('Please log in to see prices'));
     }
   }
 
-  if ($value < 0) {
-    $value = abs($value);
-    $format = '-';
+  // Force the price to a positive value and add a negative sign if necessary.
+  if (abs($price) < 0) {
+    $price = abs($price);
+    $output .= '-';
   }
 
-  if ($sign && !variable_get('uc_sign_after_amount_'. $currency, $default_sign_after)) {
-    $format .= $symbol;
+  // Get the currency symbol for this currency
+  $symbol = variable_get('uc_currency_symbol_'. $options['currency'], variable_get('uc_currency_sign', '$'));
+
+  // Add the currency sign first if specified.
+  if ($symbol && !$options['sign_after']) {
+    $output .= $symbol;
   }
 
-  $format .= number_format(
-    $value,
-    $suppress ? 0 : variable_get('uc_currency_prec_'. $currency, $default_prec),
-    !is_null($dec) ? $dec : variable_get('uc_currency_dec_'. $currency, $default_dec),
-    $thou ? variable_get('uc_currency_thou_'. $currency, $default_thou) : ''
-  );
+  // Format the number, like 1234.567 => 1,234.57
+  $output .= number_format($price, $options['prec'], $options['dec'], $options['thou']);
 
-  if ($sign && variable_get('uc_sign_after_amount_'. $currency, $default_sign_after)) {
-    $format .= $symbol;
+  // Add the currency sign last if specified.
+  if ($symbol && $options['sign_after']) {
+    $output .= $symbol;
   }
 
-  return $format;
-}
+  return $output;
+}
\ No newline at end of file
