cvs: pear /I18N/docs I18N_Currency.php I18N_Number.php
| From: | Wolfram Kriesing | Date: | Fri, 22 Nov 2002 13:46:27 +0000 |
| Subject: | cvs: pear /I18N/docs I18N_Currency.php I18N_Number.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-7525@lists.php.net to get a copy of this message | ||
cain Fri Nov 22 08:46:27 2002 EDT
Added files:
/pear/I18N/docs I18N_Currency.php I18N_Number.php
Log:
- initial commit
Index: pear/I18N/docs/I18N_Currency.php
+++ pear/I18N/docs/I18N_Currency.php
<?php
//
//
//
ini_set('include_path',ini_get('include_path').':../..');
require_once 'I18N/Currency.php';
$locales = array('de_DE','en_US','fr_FR');
foreach( $locales as $aLocale )
{
$currency = new I18N_Currency( $aLocale );
myPrint("<h1>\$currency = new I18N_Currency( '$aLocale'
);</h1>");
myPrint( $currency->format( pi() ) );
myPrint( $currency->format( 1000 ) );
myPrint( $currency->format( pi() , I18N_CURRENCY_INTERNATIONAL ) );
myPrint( $currency->format( 1000.99 , I18N_CURRENCY_INTERNATIONAL ) );
}
function myPrint( $string )
{
print "$string<br><br>";
}
?>
Index: pear/I18N/docs/I18N_Number.php
+++ pear/I18N/docs/I18N_Number.php
<?php
//
//
//
ini_set('include_path',ini_get('include_path').':../..');
require_once 'I18N/Number.php';
$locales = array('de_DE','en_US','fr_FR');
foreach( $locales as $aLocale )
{
$number = new I18N_Number( $aLocale );
myPrint("<h1>\$number = new I18N_Number( '$aLocale'
);</h1>");
//
//
//
myPrint( $number->format( pi() ) );
myPrint( $number->format( 1000000 ) );
$number->setFormat(I18N_NUMBER_INTEGER);
myPrint( $number->format( pi() ) );
myPrint( $number->format( 100000.99 ) );
// set some sencesless format, which has
// 4 - digits behind the decimal seperator
// ; - as the decimal seperator
// : - as the thousands seperator
$myFormat = $number->setFormat(array( 4 , ';' , ':' ));
myPrint( $number->format( pi() ) );
myPrint( $number->format( 1000000.99 ) );
// using all currently available formats, including myFormat, which we defined above
myPrint( $number->format( pi() , I18N_NUMBER_INTEGER ) );
myPrint( $number->format( pi() , I18N_NUMBER_FLOAT ) );
myPrint( $number->format( pi() , $myFormat ) );
}
function myPrint( $string )
{
print "$string<br>";
}
?>