Skip to content

Commit 27a65ad

Browse files
committed
no longer showing decimal separator for zero precision
1 parent 6be0835 commit 27a65ad

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Coduo/PHPHumanizer/String/BinarySuffix.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ protected function setSpecificPrecisionFormat($precision)
6767
'up to three decimal places');
6868
}
6969

70-
$icuFormat = str_pad('#.', (2+$precision), '0');
70+
$icuFormat = '#';
71+
if($precision > 0){
72+
$icuFormat .= str_pad('#.', (2+$precision), '0');
73+
}
74+
7175
foreach ($this->binaryPrefixes as $size => $unitPattern) {
7276
if($size >= 1024){
7377
$symbol = substr($unitPattern, strpos($unitPattern, ' '));

0 commit comments

Comments
 (0)