diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 5f07a5e3747..7bd7e306146 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -1278,7 +1278,7 @@ if ($_GET['propalid'] > 0)
else
print $html->select_tva("tva_tx",$objp->tva_tx,$mysoc,$societe);
print '';
- print '
| ';
+ print ' | ';
print '';
if (($objp->info_bits & 2) != 2)
{
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 32e645f7fab..2d5a0e628ff 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -1441,7 +1441,7 @@ else
else
print $html->select_tva('tva_tx',$objp->tva_tx,$mysoc,$soc);
print ' | ';
- print ' | ';
+ print ' | ';
print '';
if (($objp->info_bits & 2) != 2)
{
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 1e43a81ed20..d63a83389d5 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2389,7 +2389,7 @@ else
else
print $html->select_tva('tva_tx',$objp->tva_taux,$mysoc,$soc);
print ' | ';
- print ' | ';
+ print ' | ';
print '';
if (($objp->info_bits & 2) != 2)
{
diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php
index 52cf348ef1f..0701fef3ea2 100644
--- a/htdocs/lib/functions.inc.php
+++ b/htdocs/lib/functions.inc.php
@@ -1824,10 +1824,11 @@ function print_fleche_navigation($page,$file,$options='',$nextpage)
* \param amount Montant a formater
* \param html Formatage html ou pas (0 par defaut)
* \param outlangs Objet langs pour formatage
+* \param trunc 1=Tronque affichage si trop de décimales
* \return string Chaine avec montant formaté
* \seealso price2num Fonction inverse de price
*/
-function price($amount, $html=0, $outlangs='')
+function price($amount, $html=0, $outlangs='', $trunc=1)
{
global $langs,$conf;
@@ -1849,25 +1850,25 @@ function price($amount, $html=0, $outlangs='')
//print $datas[1]." ";
// On pose par defaut 2 decimales
- $decimal = 2;
+ $nbdecimal = 2;
$end='';
// On augmente au besoin si il y a plus de 2 décimales
- if (strlen($decpart) > $decimal) $decimal=strlen($decpart);
+ if (strlen($decpart) > $nbdecimal) $nbdecimal=strlen($decpart);
// Si on depasse max
- if ($decimal > $conf->global->MAIN_MAX_DECIMALS_SHOWN)
+ if ($trunc && $nbdecimal > $conf->global->MAIN_MAX_DECIMALS_SHOWN)
{
- $decimal=$conf->global->MAIN_MAX_DECIMALS_SHOWN;
+ $nbdecimal=$conf->global->MAIN_MAX_DECIMALS_SHOWN;
$end='...';
}
// Formate nombre
if ($html)
{
- $output=ereg_replace(' ',' ',number_format($amount, $decimal, $dec, $thousand));
+ $output=ereg_replace(' ',' ',number_format($amount, $nbdecimal, $dec, $thousand));
}
else
{
- $output=number_format($amount, $decimal, $dec, $thousand);
+ $output=number_format($amount, $nbdecimal, $dec, $thousand);
}
$output.=$end;
|