mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-22 17:31:25 +01:00
Can choose number of decimals into function showDimensionInBestUnit
This commit is contained in:
@@ -3418,9 +3418,10 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
|
|||||||
* @param int $unit Unit of dimension (0, -3, ...)
|
* @param int $unit Unit of dimension (0, -3, ...)
|
||||||
* @param string $type 'weight', 'volume', ...
|
* @param string $type 'weight', 'volume', ...
|
||||||
* @param Translate $outputlangs Translate language object
|
* @param Translate $outputlangs Translate language object
|
||||||
|
* @param int $round -1 = non rounding, x = number of decimal
|
||||||
* @return string String to show dimensions
|
* @return string String to show dimensions
|
||||||
*/
|
*/
|
||||||
function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs)
|
function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1)
|
||||||
{
|
{
|
||||||
if ($dimension < 1/10000)
|
if ($dimension < 1/10000)
|
||||||
{
|
{
|
||||||
@@ -3443,7 +3444,7 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs)
|
|||||||
$unit = $unit + 3;
|
$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;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user