Gestion format nombre selon langue

This commit is contained in:
Laurent Destailleur 2006-08-27 22:20:17 +00:00
parent 7d616a87f3
commit 0df017047c

View File

@ -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)