[TEP-COMMIT] [CVS catalog] Move decimal point and thousands seperator to the language files
anonymous-OfajU3CKLf1/[email protected] 16 Apr 2004 05:31:36 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit in catalog/catalog on MAIN
includes/classes/currencies.php +2 -4 1.19 -> 1.20
/weight.php +4 -8 1.1 -> 1.2
includes/languages/english.php +2 1.119 -> 1.120
/espanol.php +2 1.112 -> 1.113
/german.php +2 1.129 -> 1.130
install/oscommerce.sql +2 -4 1.96 -> 1.97
install/includes/functions/general.php +3 -3 1.5 -> 1.6
install/includes/languages/english.php +3 1.1 -> 1.2
/espanol.php +3 1.1 -> 1.2
/german.php +3 1.1 -> 1.2
install/templates/pages/upgrade_3.php +1 1.68 -> 1.69
+27 -19
11 modified files
Move decimal point and thousands seperator to the language files
----------
catalog /catalog /includes /classes
currencies.php 1.19 -> 1.20
diff -u -r1.19 -r1.20
--- currencies.php 2004/02/16 07:08:16 1.19
+++ currencies.php 2004/04/16 05:31:32 1.20
@@ -19,7 +19,7 @@
$this->currencies = array();
- $Qcurrencies = $osC_Database->query('select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from :table_currencies');
+ $Qcurrencies = $osC_Database->query('select code, title, symbol_left, symbol_right, decimal_places, value from :table_currencies');
$Qcurrencies->bindRaw(':table_currencies', TABLE_CURRENCIES);
$Qcurrencies->execute();
@@ -27,8 +27,6 @@
$this->currencies[$Qcurrencies->value('code')] = array('title' => $Qcurrencies->value('title'),
'symbol_left' => $Qcurrencies->value('symbol_left'),
'symbol_right' => $Qcurrencies->value('symbol_right'),
- 'decimal_point' => $Qcurrencies->value('decimal_point'),
- 'thousands_point' => $Qcurrencies->value('thousands_point'),
'decimal_places' => $Qcurrencies->valueInt('decimal_places'),
'value' => $Qcurrencies->valueDecimal('value'));
}
@@ -46,7 +44,7 @@
$currency_value = $this->currencies[$currency_code]['value'];
}
- return $this->currencies[$currency_code]['symbol_left'] . number_format(tep_round($number * $currency_value, $this->currencies[$currency_code]['decimal_places']), $this->currencies[$currency_code]['decimal_places'], $this->currencies[$currency_code]['decimal_point'], $this->currencies[$currency_code]['thousands_point']) . $this->currencies[$currency_code]['symbol_right'];
+ return $this->currencies[$currency_code]['symbol_left'] . number_format(tep_round($number * $currency_value, $this->currencies[$currency_code]['decimal_places']), $this->currencies[$currency_code]['decimal_places'], NUMERIC_DECIMAL_SEPARATOR, NUMERIC_THOUSANDS_SEPARATOR) . $this->currencies[$currency_code]['symbol_right'];
}
function displayPrice($price, $tax_class_id, $quantity = 1) {
----------
catalog /catalog /includes /classes
weight.php 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- weight.php 2004/04/15 16:05:36 1.1
+++ weight.php 2004/04/16 05:31:32 1.2
@@ -12,14 +12,10 @@
class osC_Weight {
var $weight_classes = array(),
- $decimal_point,
- $thousands_point,
$precision;
// class constructor
- function osC_Weight($decimal_point = '.', $thousands_point = '', $precision = '2') {
- $this->decimal_point = $decimal_point;
- $this->thousands_point = $thousands_point;
+ function osC_Weight($precision = '2') {
$this->precision = $precision;
$this->prepareRules();
@@ -55,14 +51,14 @@
function convert($value, $unit_from, $unit_to) {
if ($unit_from == $unit_to) {
- return number_format($value, (int)$this->precision, $this->decimal_point, $this->thousands_point);
+ return number_format($value, (int)$this->precision, NUMERIC_DECIMAL_SEPARATOR, NUMERIC_THOUSANDS_SEPARATOR);
} else {
- return number_format($value * $this->weight_classes[(int)$unit_from][(int)$unit_to], (int)$this->precision, $this->decimal_point, $this->thousands_point);
+ return number_format($value * $this->weight_classes[(int)$unit_from][(int)$unit_to], (int)$this->precision, NUMERIC_DECIMAL_SEPARATOR, NUMERIC_THOUSANDS_SEPARATOR);
}
}
function display($value, $class) {
- return number_format($value, (int)$this->precision, $this->decimal_point, $this->thousands_point) . $this->weight_classes[$class]['key'];
+ return number_format($value, (int)$this->precision, NUMERIC_DECIMAL_SEPARATOR, NUMERIC_THOUSANDS_SEPARATOR) . $this->weight_classes[$class]['key'];
}
}
?>
----------
catalog /catalog /includes /languages
english.php 1.119 -> 1.120
diff -u -r1.119 -r1.120
--- english.php 2004/04/14 23:22:52 1.119
+++ english.php 2004/04/16 05:31:33 1.120
@@ -37,6 +37,8 @@
// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
define('LANGUAGE_CURRENCY', 'USD');
+define('NUMERIC_DECIMAL_SEPARATOR', '.');
+define('NUMERIC_THOUSANDS_SEPARATOR', ',');
// Global entries for the <html> tag
define('HTML_PARAMS','dir="LTR" lang="en"');
----------
catalog /catalog /includes /languages
espanol.php 1.112 -> 1.113
diff -u -r1.112 -r1.113
--- espanol.php 2004/04/14 23:22:52 1.112
+++ espanol.php 2004/04/16 05:31:33 1.113
@@ -37,6 +37,8 @@
// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
define('LANGUAGE_CURRENCY', 'EUR');
+define('NUMERIC_DECIMAL_SEPARATOR', '.');
+define('NUMERIC_THOUSANDS_SEPARATOR', ',');
// Global entries for the <html> tag
define('HTML_PARAMS','dir="LTR" lang="es"');
----------
catalog /catalog /includes /languages
german.php 1.129 -> 1.130
diff -u -r1.129 -r1.130
--- german.php 2004/04/14 23:22:53 1.129
+++ german.php 2004/04/16 05:31:33 1.130
@@ -37,6 +37,8 @@
// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
define('LANGUAGE_CURRENCY', 'EUR');
+define('NUMERIC_DECIMAL_SEPARATOR', ',');
+define('NUMERIC_THOUSANDS_SEPARATOR', '.');
// Global entries for the <html> tag
define('HTML_PARAMS','dir="LTR" lang="de"');
----------
catalog /catalog /install
oscommerce.sql 1.96 -> 1.97
diff -u -r1.96 -r1.97
--- oscommerce.sql 2004/04/15 16:05:41 1.96
+++ oscommerce.sql 2004/04/16 05:31:34 1.97
@@ -150,8 +150,6 @@
code char(3) NOT NULL,
symbol_left varchar(12),
symbol_right varchar(12),
- decimal_point char(1),
- thousands_point char(1),
decimal_places char(1),
value float(13,8),
last_updated datetime NULL,
@@ -1004,8 +1002,8 @@
INSERT INTO osc_countries VALUES (238,'Zambia','ZM','ZMB','1');
INSERT INTO osc_countries VALUES (239,'Zimbabwe','ZW','ZWE','1');
-INSERT INTO osc_currencies VALUES (1,'US Dollar','USD','$','','.',',','2','1.0000', now());
-INSERT INTO osc_currencies VALUES (2,'Euro','EUR','','EUR','.',',','2','1.1036', now());
+INSERT INTO osc_currencies VALUES (1,'US Dollar','USD','$','','2','1.0000', now());
+INSERT INTO osc_currencies VALUES (2,'Euro','EUR','','EUR','2','1.1036', now());
INSERT INTO osc_languages VALUES (1,'English','en','icon.gif','english',1);
INSERT INTO osc_languages VALUES (2,'Deutsch','de','icon.gif','german',2);
----------
catalog /catalog /install /includes /functions
general.php 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- general.php 2004/02/16 06:59:35 1.5
+++ general.php 2004/04/16 05:31:34 1.6
@@ -28,7 +28,7 @@
}
function tep_currency_format($number, $calculate_currency_value = true, $currency_code = 'USD', $value = '') {
- $Qcurrencies = $osC_Database->query('select symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from currencies where code = :code');
+ $Qcurrencies = $osC_Database->query('select symbol_left, symbol_right, decimal_places, value from currencies where code = :code');
$Qcurrencies->bindValue(':code', $currency_code);
$Qcurrencies->execute();
@@ -42,9 +42,9 @@
} else {
$rate = 1;
}
- $number2currency = $Qcurrencies->value('symbol_left') . number_format(($number * $rate), $Qcurrencies->value('decimal_places'), $Qcurrencies->value('decimal_point'), $Qcurrencies->value('thousands_point')) . $Qcurrencies->value('symbol_right');
+ $number2currency = $Qcurrencies->value('symbol_left') . number_format(($number * $rate), $Qcurrencies->value('decimal_places'), NUMERIC_DECIMAL_SEPARATOR, NUMERIC_THOUSANDS_SEPARATOR) . $Qcurrencies->value('symbol_right');
} else {
- $number2currency = $Qcurrencies->value('symbol_left') . number_format($number, $Qcurrencies->value('decimal_places'), $Qcurrencies->value('decimal_point'), $Qcurrencies->value('thousands_point')) . $Qcurrencies->value('symbol_right');
+ $number2currency = $Qcurrencies->value('symbol_left') . number_format($number, $Qcurrencies->value('decimal_places'), NUMERIC_DECIMAL_SEPARATOR, NUMERIC_THOUSANDS_SEPARATOR) . $Qcurrencies->value('symbol_right');
}
$Qcurrencies->freeResult();
----------
catalog /catalog /install /includes /languages
english.php 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- english.php 2004/02/16 06:59:35 1.1
+++ english.php 2004/04/16 05:31:35 1.2
@@ -10,6 +10,9 @@
Released under the GNU General Public License
*/
+ define('NUMERIC_DECIMAL_SEPARATOR', '.');
+ define('NUMERIC_THOUSANDS_SEPARATOR', ',');
+
define('ERROR_DB_NO_SERVER_SELECTED', 'No server selected.');
define('ERROR_DB_NO_DATABASE_SELECTED', 'No database selected.');
----------
catalog /catalog /install /includes /languages
espanol.php 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- espanol.php 2004/02/16 06:59:35 1.1
+++ espanol.php 2004/04/16 05:31:35 1.2
@@ -10,6 +10,9 @@
Released under the GNU General Public License
*/
+ define('NUMERIC_DECIMAL_SEPARATOR', '.');
+ define('NUMERIC_THOUSANDS_SEPARATOR', ',');
+
define('ERROR_DB_NO_SERVER_SELECTED', 'No server selected.');
define('ERROR_DB_NO_DATABASE_SELECTED', 'No database selected.');
----------
catalog /catalog /install /includes /languages
german.php 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- german.php 2004/02/16 06:59:35 1.1
+++ german.php 2004/04/16 05:31:35 1.2
@@ -10,6 +10,9 @@
Released under the GNU General Public License
*/
+ define('NUMERIC_DECIMAL_SEPARATOR', '.');
+ define('NUMERIC_THOUSANDS_SEPARATOR', ',');
+
define('ERROR_DB_NO_SERVER_SELECTED', 'No server selected.');
define('ERROR_DB_NO_DATABASE_SELECTED', 'No database selected.');
----------
catalog /catalog /install /templates /pages
upgrade_3.php 1.68 -> 1.69
diff -u -r1.68 -r1.69
--- upgrade_3.php 2004/04/14 23:22:59 1.68
+++ upgrade_3.php 2004/04/16 05:31:35 1.69
@@ -342,6 +342,7 @@
$osC_Database->simpleQuery("alter table currencies add value float(13,8)");
$osC_Database->simpleQuery("alter table currencies add last_updated datetime");
+ $osC_Database->simpleQuery("alter table currencies drop decimal_point, drop thousands_point");
$osC_Database->simpleQuery("update currencies set value = '1'");
?>
CVSspam 0.2.8
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click