Skip to content

Commit 95ca639

Browse files
author
Jippe Holwerda
committed
Format sizes with 1 decimal in order to prevent weird rounding behaviour.
1 parent 1063771 commit 95ca639

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/views/compress-details.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
<?php if ($savings["input"] - $savings["output"]) { ?>
4444
<span class="message">
45-
<?php printf( self::translate_escape( 'Total savings %s' ), str_replace( " ", "&nbsp;", size_format( $savings["input"] - $savings["output"] ) ) ) ?>
45+
<?php printf(self::translate_escape( 'Total savings %s' ), str_replace( " ", "&nbsp;", size_format($savings["input"] - $savings["output"], 1))) ?>
4646
</span>
4747
<br />
4848
<?php } ?>
@@ -96,8 +96,8 @@
9696
}
9797
?>
9898
</td>
99-
<td><?php echo size_format( $meta["input"]["size"] ) ?></td>
100-
<td><?php echo size_format( $meta["output"]["size"] ) ?></td>
99+
<td><?php echo size_format($meta["input"]["size"], 1) ?></td>
100+
<td><?php echo size_format($meta["output"]["size"], 1) ?></td>
101101
<td><?php echo human_time_diff($tiny_metadata->get_end_time($size)) . ' ' . self::translate_escape('ago') ?></td>
102102
</tr>
103103
<?php $i++; ?>
@@ -106,14 +106,14 @@
106106
<tfoot>
107107
<tr>
108108
<td><?php echo self::translate_escape('Combined') ?></td>
109-
<td><?php echo size_format( $savings['input'] ) ?></td>
110-
<td><?php echo size_format( $savings['output'] ) ?></td>
109+
<td><?php echo size_format($savings['input'], 1) ?></td>
110+
<td><?php echo size_format($savings['output'], 1) ?></td>
111111
<td></td>
112112
</tr>
113113
</tfoot>
114114
<?php } ?>
115115
</table>
116-
<p><strong><?php printf( self::translate_escape( 'Total savings %s' ), size_format( $savings["input"] - $savings["output"] ) ) ?></strong></p>
116+
<p><strong><?php printf( self::translate_escape( 'Total savings %s' ), size_format($savings["input"] - $savings["output"], 1)) ?></strong></p>
117117
</div>
118118
</div>
119119
<?php } ?>

0 commit comments

Comments
 (0)