Display popularity with less decimal points

Limit the display to two decimal points for packages with a popularity
of at least 0.2.

Suggested-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2019-10-26 21:08:03 -04:00
parent c1e5ffb12a
commit 99a3ced73b
2 changed files with 2 additions and 2 deletions

View file

@ -259,7 +259,7 @@ endif;
</tr> </tr>
<tr> <tr>
<th><?= __('Popularity') . ': ' ?></th> <th><?= __('Popularity') . ': ' ?></th>
<td><?= number_format($popularity, 6) ?></td> <td><?= number_format($popularity, $popularity >= .2 ? 2 : 6) ?></td>
</tr> </tr>
<tr> <tr>
<th><?= __('First Submitted') . ': ' ?></th> <th><?= __('First Submitted') . ': ' ?></th>

View file

@ -108,7 +108,7 @@ endif;
</tr> </tr>
<tr> <tr>
<th><?= __('Popularity') . ': ' ?></th> <th><?= __('Popularity') . ': ' ?></th>
<td><?= number_format($popularity, 6) ?></td> <td><?= number_format($popularity, $popularity >= .2 ? 2 : 6) ?></td>
</tr> </tr>
<tr> <tr>
<th><?= __('First Submitted') . ': ' ?></th> <th><?= __('First Submitted') . ': ' ?></th>