2
0
forked from Wavyzz/dolibarr

Can choose number of decimals into function showDimensionInBestUnit

This commit is contained in:
Laurent Destailleur
2016-03-09 23:17:46 +01:00
parent 4b0b1fb5f6
commit 8ab343e95f

View File

@@ -3418,9 +3418,10 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
* @param int $unit Unit of dimension (0, -3, ...)
* @param string $type 'weight', 'volume', ...
* @param Translate $outputlangs Translate language object
* @param int $round -1 = non rounding, x = number of decimal
* @return string String to show dimensions
*/
function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs)
function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1)
{
if ($dimension < 1/10000)
{
@@ -3443,7 +3444,7 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs)
$unit = $unit + 3;
}
$ret=price($dimension, 0, $outputlangs, 0, 0).' '.measuring_units_string($unit, $type);
$ret=price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuring_units_string($unit, $type);
return $ret;
}