diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index c806304b423..61ab229647a 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -1710,21 +1710,22 @@ function print_duree_select($prefix) \remarks Fonction utilisée dans les pdf et les pages html \param amount Montant a formater \param html Formatage html ou pas (0 par defaut) - \param langs Objet langs + \param outlangs Objet langs pour formatage \seealso price2num Fonction inverse de price */ -function price($amount, $html=0, $langs='') +function price($amount, $html=0, $outlangs='') { + global $langs; + // Separateurs par defaut $dec='.'; $thousand=' '; - // Si $langs defini - if (is_object($langs)) - { - if ($langs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$langs->trans("SeparatorDecimal"); - if ($langs->trans("SeparatorThousand")!= "SeparatorThousand") $thousand=$langs->trans("SeparatorThousand"); - //print "x".$langs->trans("SeparatorThousand")."x"; - } + // Si $outlangs non force, on prend langue utilisateur + if (! is_object($outlangs)) $outlangs=$langs; + + if ($outlangs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$outlangs->trans("SeparatorDecimal"); + if ($outlangs->trans("SeparatorThousand")!= "SeparatorThousand") $thousand=$outlangs->trans("SeparatorThousand"); + //print "x".$langs->trans("SeparatorThousand")."x"; // Formate nombre if ($html)