Skip to content
Snippets Groups Projects
Commit 03bcb692 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update ph.toUnit: show value 0

parent 3d5a77be
No related branches found
No related tags found
1 merge request!244Docker checks: add docker net io
......@@ -320,6 +320,12 @@ function ph.toUnit(){
local _value=$1
local _unit=$2
local _digits=${3:-0}
local _dots
if [ "$_value" -eq "0" ]; then
echo "0"
return 0
fi
local _multiply; _multiply=$( ph._getExp "$_value" )
local _divisor; _divisor=$( ph._getExp "$_unit" )
......@@ -327,7 +333,6 @@ function ph.toUnit(){
local _bc
_bc="bc"
local _dots
test $_digits -gt 0 && _dots=$( yes "." 2>/dev/null | head -$_digits | tr -d "\n" )
test $_digits -gt 0 && _bc+=" -l | grep -o '.*\\.${_dots}'"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment