Fixed the skipif wordings and styles (#1070)
This commit is contained in:
parent
23f92effab
commit
f64df0497f
|
@ -21,6 +21,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && \
|
||||||
make \
|
make \
|
||||||
php7.3 \
|
php7.3 \
|
||||||
php7.3-dev \
|
php7.3-dev \
|
||||||
|
php7.3-intl \
|
||||||
python-pip \
|
python-pip \
|
||||||
re2c \
|
re2c \
|
||||||
unixodbc-dev \
|
unixodbc-dev \
|
||||||
|
|
|
@ -59,6 +59,8 @@ jobs:
|
||||||
displayName: 'Build and install drivers'
|
displayName: 'Build and install drivers'
|
||||||
|
|
||||||
- job: Linux
|
- job: Linux
|
||||||
|
variables:
|
||||||
|
phpver: 7.3
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-18.04'
|
vmImage: 'ubuntu-18.04'
|
||||||
steps:
|
steps:
|
||||||
|
@ -72,13 +74,13 @@ jobs:
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
sudo update-alternatives --set php /usr/bin/php$(phpVersion)
|
sudo update-alternatives --set php /usr/bin/php$(phpver)
|
||||||
sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
|
sudo update-alternatives --set phar /usr/bin/phar$(phpver)
|
||||||
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
|
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpver)
|
||||||
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
|
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpver)
|
||||||
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
|
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpver)
|
||||||
php -version
|
php -version
|
||||||
displayName: 'Use PHP version $(phpVersion)'
|
displayName: 'Use PHP version $(phpver)'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
echo install ODBC and dependencies
|
echo install ODBC and dependencies
|
||||||
|
@ -128,6 +130,7 @@ jobs:
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
echo ready to build extensions
|
echo ready to build extensions
|
||||||
|
sudo apt-get install -y php$(phpver)-intl
|
||||||
cd $(Build.SourcesDirectory)/source
|
cd $(Build.SourcesDirectory)/source
|
||||||
chmod a+x packagize.sh
|
chmod a+x packagize.sh
|
||||||
./packagize.sh
|
./packagize.sh
|
||||||
|
|
|
@ -46,7 +46,7 @@ Current LC_CTYPE: en_US.UTF-8
|
||||||
Setting LC_ALL: en_US.ISO-8859-1
|
Setting LC_ALL: en_US.ISO-8859-1
|
||||||
Currency symbol: $
|
Currency symbol: $
|
||||||
Thousands_sep: ,
|
Thousands_sep: ,
|
||||||
Amount formatted: USD 10,000.99
|
Amount formatted: $10,000.99
|
||||||
Friday
|
Friday
|
||||||
December
|
December
|
||||||
3.14159
|
3.14159
|
||||||
|
@ -71,7 +71,7 @@ Current LC_CTYPE: en_US.UTF-8
|
||||||
Setting LC_ALL: de_DE.UTF-8
|
Setting LC_ALL: de_DE.UTF-8
|
||||||
Currency symbol: €
|
Currency symbol: €
|
||||||
Thousands_sep: .
|
Thousands_sep: .
|
||||||
Amount formatted: 10.000,99 EUR
|
Amount formatted: 10.000,99 €
|
||||||
Freitag
|
Freitag
|
||||||
Dezember
|
Dezember
|
||||||
3,14159
|
3,14159
|
||||||
|
@ -85,7 +85,7 @@ Current LC_MONETARY: en_US.UTF-8
|
||||||
Current LC_CTYPE: en_US.UTF-8
|
Current LC_CTYPE: en_US.UTF-8
|
||||||
Currency symbol: $
|
Currency symbol: $
|
||||||
Thousands_sep: ,
|
Thousands_sep: ,
|
||||||
Amount formatted: USD 10,000.99
|
Amount formatted: $10,000.99
|
||||||
Friday
|
Friday
|
||||||
December
|
December
|
||||||
3.14159
|
3.14159
|
||||||
|
@ -96,7 +96,7 @@ Current LC_CTYPE: en_US.UTF-8
|
||||||
Setting LC_ALL: de_DE.UTF-8
|
Setting LC_ALL: de_DE.UTF-8
|
||||||
Currency symbol: €
|
Currency symbol: €
|
||||||
Thousands_sep: .
|
Thousands_sep: .
|
||||||
Amount formatted: 10.000,99 EUR
|
Amount formatted: 10.000,99 €
|
||||||
Freitag
|
Freitag
|
||||||
Dezember
|
Dezember
|
||||||
3,14159
|
3,14159
|
||||||
|
|
|
@ -6,6 +6,27 @@ function dropTable($conn, $tableName)
|
||||||
$conn->exec($tsql);
|
$conn->exec($tsql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function printMoney($amt)
|
||||||
|
{
|
||||||
|
// The money_format() function is deprecated in PHP 7.4, so use intl NumberFormatter
|
||||||
|
$info = localeconv();
|
||||||
|
echo "Currency symbol: " . $info['currency_symbol'] . PHP_EOL;
|
||||||
|
echo "Thousands_sep: " . $info['thousands_sep'] . PHP_EOL;
|
||||||
|
|
||||||
|
$loc = setlocale(LC_MONETARY, 0);
|
||||||
|
$symbol = $info['int_curr_symbol'];
|
||||||
|
|
||||||
|
echo "Amount formatted: ";
|
||||||
|
if (empty($symbol)) {
|
||||||
|
echo number_format($amt, 2, '.', '');
|
||||||
|
} else {
|
||||||
|
$fmt = new NumberFormatter($loc, NumberFormatter::CURRENCY);
|
||||||
|
$fmt->setTextAttribute(NumberFormatter::CURRENCY_CODE, $symbol);
|
||||||
|
$fmt->setAttribute(NumberFormatter::FRACTION_DIGITS, 2);
|
||||||
|
echo $fmt->format($amt);
|
||||||
|
}
|
||||||
|
echo PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
// This test is invoked by pdo_1063_locale_configs.phpt
|
// This test is invoked by pdo_1063_locale_configs.phpt
|
||||||
require_once('MsSetup.inc');
|
require_once('MsSetup.inc');
|
||||||
|
@ -21,12 +42,9 @@ if (!empty($locale)) {
|
||||||
echo "Setting LC_ALL: " . $loc . PHP_EOL;
|
echo "Setting LC_ALL: " . $loc . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
$info = localeconv();
|
|
||||||
echo "Currency symbol: " . $info['currency_symbol'] . PHP_EOL;
|
|
||||||
echo "Thousands_sep: " . $info['thousands_sep'] . PHP_EOL;
|
|
||||||
|
|
||||||
$n1 = 10000.98765;
|
$n1 = 10000.98765;
|
||||||
echo "Amount formatted: " . money_format("%i", $n1) . PHP_EOL;
|
printMoney($n1);
|
||||||
|
|
||||||
echo strftime("%A", strtotime("12/25/2020")) . PHP_EOL;
|
echo strftime("%A", strtotime("12/25/2020")) . PHP_EOL;
|
||||||
echo strftime("%B", strtotime("12/25/2020")) . PHP_EOL;
|
echo strftime("%B", strtotime("12/25/2020")) . PHP_EOL;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv'))
|
if (!extension_loaded("pdo_sqlsrv")) {
|
||||||
die("PDO driver cannot be loaded; skipping test.\n");
|
die("skip Extension not loaded");
|
||||||
?>
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv'))
|
if (!extension_loaded("pdo_sqlsrv")) {
|
||||||
die("PDO driver cannot be loaded; skipping test.\n");
|
die("skip Extension not loaded");
|
||||||
|
}
|
||||||
require 'MsSetup.inc';
|
require 'MsSetup.inc';
|
||||||
if ($daasMode) die("skip test not applicable in Azure\n");
|
if ($daasMode) {
|
||||||
|
die("skip test not applicable in Azure\n");
|
||||||
?>
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv')) {
|
if (!extension_loaded("pdo_sqlsrv")) {
|
||||||
die("PDO driver cannot be loaded; skipping test.\n");
|
die("skip Extension not loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once("MsSetup.inc");
|
require_once("MsSetup.inc");
|
||||||
|
@ -9,7 +9,7 @@ require_once("MsCommon_mid-refactor.inc");
|
||||||
$dsn = getDSN($server, null);
|
$dsn = getDSN($server, null);
|
||||||
$conn = new PDO($dsn, $uid, $pwd);
|
$conn = new PDO($dsn, $uid, $pwd);
|
||||||
if (! $conn) {
|
if (! $conn) {
|
||||||
echo("Error: could not connect during SKIPIF!");
|
die("skip could not connect during SKIPIF!");
|
||||||
} elseif (isColEncrypted()) {
|
} elseif (isColEncrypted()) {
|
||||||
if (!isAEQualified($conn)) {
|
if (!isAEQualified($conn)) {
|
||||||
die("skip - AE feature not supported in the current environment.");
|
die("skip - AE feature not supported in the current environment.");
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv')) {
|
if (!extension_loaded("pdo_sqlsrv")) {
|
||||||
die("PDO driver cannot be loaded; skipping test.\n");
|
die("skip Extension not loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once("MsSetup.inc");
|
require_once("MsSetup.inc");
|
||||||
|
|
||||||
if ($keystore != 'akv')
|
if ($keystore != 'akv') {
|
||||||
die ( 'skip - the test requires valid Azure Key Vault credentials.' );
|
die('skip the test requires valid Azure Key Vault credentials.');
|
||||||
|
}
|
||||||
|
|
||||||
if ($driver != "ODBC Driver 17 for SQL Server") {
|
if ($driver != "ODBC Driver 17 for SQL Server") {
|
||||||
// the testing is not set to use ODBC 17
|
// the testing is not set to use ODBC 17
|
||||||
die("skip - AE feature not supported in the current environment.");
|
die("skip AE feature not supported in the current environment.");
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once("MsCommon_mid-refactor.inc");
|
require_once("MsCommon_mid-refactor.inc");
|
||||||
|
@ -18,7 +19,7 @@ require_once("MsCommon_mid-refactor.inc");
|
||||||
$dsn = getDSN($server, null);
|
$dsn = getDSN($server, null);
|
||||||
$conn = new PDO($dsn, $uid, $pwd);
|
$conn = new PDO($dsn, $uid, $pwd);
|
||||||
if (! $conn) {
|
if (! $conn) {
|
||||||
echo("Error: could not connect during SKIPIF!");
|
die("skip could not connect during SKIPIF!");
|
||||||
} elseif (!isAEQualified($conn)) {
|
} elseif (!isAEQualified($conn)) {
|
||||||
die("skip - AE feature not supported in the current environment.");
|
die("skip AE feature not supported in the current environment.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip, test on windows only." );
|
if (!(strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN')) {
|
||||||
|
die("Skip test on windows only.");
|
||||||
|
}
|
||||||
|
|
||||||
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv'))
|
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv')) {
|
||||||
die("PDO driver cannot be loaded; skipping test.\n");
|
die("skip extension not loaded");
|
||||||
|
}
|
||||||
?>
|
|
||||||
|
|
|
@ -1,29 +1,28 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
die("Skipped: Test for Linux and macOS");
|
die("skip Test for Linux and macOS");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!extension_loaded("sqlsrv")) {
|
if (!extension_loaded("pdo_sqlsrv")) {
|
||||||
die("skip extension not loaded");
|
die("skip Extension not loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the required ini file exists
|
// check if the required ini file exists
|
||||||
$inifile = PHP_CONFIG_FILE_SCAN_DIR."/99-overrides.ini";
|
$inifile = PHP_CONFIG_FILE_SCAN_DIR."/99-overrides.ini";
|
||||||
if (!file_exists($inifile)) {
|
if (!file_exists($inifile)) {
|
||||||
die("required ini file not exists");
|
die("skip required ini file not exists");
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the file exists, is it writable? '@' sign is used to suppress warnings
|
// if the file exists, is it writable? '@' sign is used to suppress warnings
|
||||||
$file = @fopen($inifile, "w");
|
$file = @fopen($inifile, "w");
|
||||||
if (!$file) {
|
if (!$file) {
|
||||||
die("required ini file not writable");
|
die("skip required ini file not writable");
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
$loc = setlocale(LC_TIME, 'de_DE.UTF-8');
|
$loc = setlocale(LC_TIME, 'de_DE.UTF-8');
|
||||||
if (empty($loc)) {
|
if (empty($loc)) {
|
||||||
die("required locale not available");
|
die("skip required locale not available");
|
||||||
}
|
}
|
||||||
?>
|
|
|
@ -1,18 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (! extension_loaded( 'pdo' ) || ! extension_loaded( 'pdo_sqlsrv' ))
|
if (!extension_loaded("pdo_sqlsrv")) {
|
||||||
die( "PDO driver cannot be loaded; skipping test.\n" );
|
die("skip Extension not loaded");
|
||||||
|
}
|
||||||
|
|
||||||
require_once("MsSetup.inc");
|
require_once("MsSetup.inc");
|
||||||
require_once("MsCommon.inc");
|
require_once("MsCommon.inc");
|
||||||
|
|
||||||
$conn = ae_connect();
|
$conn = ae_connect();
|
||||||
if( ! $conn )
|
if (! $conn) {
|
||||||
{
|
die("skip could not connect during SKIPIF!");
|
||||||
echo( "Error: could not connect during SKIPIF!" );
|
} elseif (! IsAEQualified($conn)) {
|
||||||
|
die("skip AE feature not supported in the current environment.");
|
||||||
}
|
}
|
||||||
else if(! IsAEQualified($conn))
|
|
||||||
{
|
|
||||||
die( "skip - AE feature not supported in the current environment." );
|
|
||||||
}
|
|
||||||
?>
|
|
|
@ -5,20 +5,20 @@ if (! extension_loaded("sqlsrv")) {
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once("MsSetup.inc");
|
require_once("MsSetup.inc");
|
||||||
if ($keystore != 'akv')
|
if ($keystore != 'akv') {
|
||||||
die ( 'skip - the test requires valid Azure Key Vault credentials.' );
|
die('skip the test requires valid Azure Key Vault credentials.');
|
||||||
|
}
|
||||||
|
|
||||||
if ($driver != "ODBC Driver 17 for SQL Server") {
|
if ($driver != "ODBC Driver 17 for SQL Server") {
|
||||||
// the testing is not set to use ODBC 17
|
// the testing is not set to use ODBC 17
|
||||||
die("skip - AE feature not supported in the current environment.");
|
die("skip AE feature not supported in the current environment.");
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('MsCommon.inc');
|
require_once('MsCommon.inc');
|
||||||
|
|
||||||
$conn = AE\connect();
|
$conn = AE\connect();
|
||||||
if (! $conn) {
|
if (! $conn) {
|
||||||
echo("Error: could not connect during SKIPIF!");
|
die("skip could not connect during SKIPIF!");
|
||||||
} elseif (!AE\isQualified($conn)) {
|
} elseif (!AE\isQualified($conn)) {
|
||||||
die("skip - AE feature not supported in the current environment.");
|
die("skip AE feature not supported in the current environment.");
|
||||||
}
|
}
|
||||||
?>
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip, test on windows only." );
|
if (!(strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN')) {
|
||||||
|
die("Skip Test on windows only.");
|
||||||
|
}
|
||||||
|
|
||||||
if (!extension_loaded("sqlsrv")) {
|
if (!extension_loaded("sqlsrv")) {
|
||||||
die("skip extension not loaded");
|
die("skip extension not loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
die("Skipped: Test for Linux and macOS");
|
die("skip: Test for Linux and macOS");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!extension_loaded("sqlsrv")) {
|
if (!extension_loaded("sqlsrv")) {
|
||||||
|
@ -11,19 +11,18 @@ if (!extension_loaded("sqlsrv")) {
|
||||||
// check if the required ini file exists
|
// check if the required ini file exists
|
||||||
$inifile = PHP_CONFIG_FILE_SCAN_DIR."/99-overrides.ini";
|
$inifile = PHP_CONFIG_FILE_SCAN_DIR."/99-overrides.ini";
|
||||||
if (!file_exists($inifile)) {
|
if (!file_exists($inifile)) {
|
||||||
die("required ini file not exists");
|
die("skip required ini file not exists");
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the file exists, is it writable? '@' sign is used to suppress warnings
|
// if the file exists, is it writable? '@' sign is used to suppress warnings
|
||||||
$file = @fopen($inifile, "w");
|
$file = @fopen($inifile, "w");
|
||||||
if (!$file) {
|
if (!$file) {
|
||||||
die("required ini file not writable");
|
die("skip required ini file not writable");
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
$loc = setlocale(LC_TIME, 'de_DE.UTF-8');
|
$loc = setlocale(LC_TIME, 'de_DE.UTF-8');
|
||||||
if (empty($loc)) {
|
if (empty($loc)) {
|
||||||
die("required locale not available");
|
die("skip required locale not available");
|
||||||
}
|
}
|
||||||
?>
|
|
|
@ -8,10 +8,9 @@ require_once('MsCommon.inc');
|
||||||
|
|
||||||
$conn = AE\connect();
|
$conn = AE\connect();
|
||||||
if (! $conn) {
|
if (! $conn) {
|
||||||
echo("Error: could not connect during SKIPIF!");
|
die("Skip Could not connect during SKIPIF!");
|
||||||
} elseif (AE\isColEncrypted()) {
|
} elseif (AE\isColEncrypted()) {
|
||||||
if (!AE\isQualified($conn)) {
|
if (!AE\isQualified($conn)) {
|
||||||
die("skip - AE feature not supported in the current environment.");
|
die("skip AE feature not supported in the current environment.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
|
@ -46,7 +46,7 @@ Current LC_CTYPE: en_US.UTF-8
|
||||||
Setting LC_ALL: en_US.ISO-8859-1
|
Setting LC_ALL: en_US.ISO-8859-1
|
||||||
Currency symbol: $
|
Currency symbol: $
|
||||||
Thousands_sep: ,
|
Thousands_sep: ,
|
||||||
Amount formatted: USD 10,000.99
|
Amount formatted: $10,000.99
|
||||||
Friday
|
Friday
|
||||||
December
|
December
|
||||||
3.14159
|
3.14159
|
||||||
|
@ -71,7 +71,7 @@ Current LC_CTYPE: en_US.UTF-8
|
||||||
Setting LC_ALL: de_DE.UTF-8
|
Setting LC_ALL: de_DE.UTF-8
|
||||||
Currency symbol: €
|
Currency symbol: €
|
||||||
Thousands_sep: .
|
Thousands_sep: .
|
||||||
Amount formatted: 10.000,99 EUR
|
Amount formatted: 10.000,99 €
|
||||||
Freitag
|
Freitag
|
||||||
Dezember
|
Dezember
|
||||||
3,14159
|
3,14159
|
||||||
|
@ -85,7 +85,7 @@ Current LC_MONETARY: en_US.UTF-8
|
||||||
Current LC_CTYPE: en_US.UTF-8
|
Current LC_CTYPE: en_US.UTF-8
|
||||||
Currency symbol: $
|
Currency symbol: $
|
||||||
Thousands_sep: ,
|
Thousands_sep: ,
|
||||||
Amount formatted: USD 10,000.99
|
Amount formatted: $10,000.99
|
||||||
Friday
|
Friday
|
||||||
December
|
December
|
||||||
3.14159
|
3.14159
|
||||||
|
@ -96,7 +96,7 @@ Current LC_CTYPE: en_US.UTF-8
|
||||||
Setting LC_ALL: de_DE.UTF-8
|
Setting LC_ALL: de_DE.UTF-8
|
||||||
Currency symbol: €
|
Currency symbol: €
|
||||||
Thousands_sep: .
|
Thousands_sep: .
|
||||||
Amount formatted: 10.000,99 EUR
|
Amount formatted: 10.000,99 €
|
||||||
Freitag
|
Freitag
|
||||||
Dezember
|
Dezember
|
||||||
3,14159
|
3,14159
|
||||||
|
|
|
@ -12,6 +12,28 @@ function fatalError($message)
|
||||||
die($message);
|
die($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function printMoney($amt)
|
||||||
|
{
|
||||||
|
// The money_format() function is deprecated in PHP 7.4, so use intl NumberFormatter
|
||||||
|
$info = localeconv();
|
||||||
|
echo "Currency symbol: " . $info['currency_symbol'] . PHP_EOL;
|
||||||
|
echo "Thousands_sep: " . $info['thousands_sep'] . PHP_EOL;
|
||||||
|
|
||||||
|
$loc = setlocale(LC_MONETARY, 0);
|
||||||
|
$symbol = $info['int_curr_symbol'];
|
||||||
|
|
||||||
|
echo "Amount formatted: ";
|
||||||
|
if (empty($symbol)) {
|
||||||
|
echo number_format($amt, 2, '.', '');
|
||||||
|
} else {
|
||||||
|
$fmt = new NumberFormatter($loc, NumberFormatter::CURRENCY);
|
||||||
|
$fmt->setTextAttribute(NumberFormatter::CURRENCY_CODE, $symbol);
|
||||||
|
$fmt->setAttribute(NumberFormatter::FRACTION_DIGITS, 2);
|
||||||
|
echo $fmt->format($amt);
|
||||||
|
}
|
||||||
|
echo PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
// This test is invoked by srv_1063_locale_configs.phpt
|
// This test is invoked by srv_1063_locale_configs.phpt
|
||||||
require_once('MsSetup.inc');
|
require_once('MsSetup.inc');
|
||||||
|
|
||||||
|
@ -26,12 +48,9 @@ if (!empty($locale)) {
|
||||||
echo "Setting LC_ALL: " . $loc . PHP_EOL;
|
echo "Setting LC_ALL: " . $loc . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
$info = localeconv();
|
|
||||||
echo "Currency symbol: " . $info['currency_symbol'] . PHP_EOL;
|
|
||||||
echo "Thousands_sep: " . $info['thousands_sep'] . PHP_EOL;
|
|
||||||
|
|
||||||
$n1 = 10000.98765;
|
$n1 = 10000.98765;
|
||||||
echo "Amount formatted: " . money_format("%i", $n1) . PHP_EOL;
|
printMoney($n1);
|
||||||
|
|
||||||
echo strftime("%A", strtotime("12/25/2020")) . PHP_EOL;
|
echo strftime("%A", strtotime("12/25/2020")) . PHP_EOL;
|
||||||
echo strftime("%B", strtotime("12/25/2020")) . PHP_EOL;
|
echo strftime("%B", strtotime("12/25/2020")) . PHP_EOL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue