Stop stripping trailing zeros from duration in 3.0

Fixes #184
pull/189/head
Justin Hileman 5 years ago
parent 4ccdd7bdcf
commit b13f022708

@ -42,11 +42,15 @@ function __bobthefish_pretty_ms -S -a ms interval -d 'Millisecond formatting for
end
switch $FISH_VERSION
# Fish 2.3 and lower doesn't know about the -s argument to math.
case 2.0.\* 2.1.\* 2.2.\* 2.3.\*
# Fish 2.3 and lower doesn't know about the -s argument to math.
math "scale=$scale;$ms/$interval_ms" | string replace -r '\\.?0*$' $interval
case \*
case 2.\*
# Fish 2.x always returned a float when given the -s argument.
math -s$scale "$ms/$interval_ms" | string replace -r '\\.?0*$' $interval
case \*
math -s$scale "$ms/$interval_ms"
echo -ns $interval
end
end

Loading…
Cancel
Save