diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2019-10-27 02:08:03 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2019-10-27 02:09:35 +0100 |
commit | 99a3ced73bbb15dc7f0113efa49464d50da67b9a (patch) | |
tree | 820339cb0fbb645ccc64eb879ff5d71253574257 /web/template | |
parent | c1e5ffb12aaf12cc147e35283dae9e772e3a6345 (diff) | |
download | aur-99a3ced73bbb15dc7f0113efa49464d50da67b9a.tar.gz aur-99a3ced73bbb15dc7f0113efa49464d50da67b9a.tar.xz |
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>
Diffstat (limited to 'web/template')
-rw-r--r-- | web/template/pkg_details.php | 2 | ||||
-rw-r--r-- | web/template/pkgbase_details.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 650c245c..93b5f1e5 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -259,7 +259,7 @@ endif; </tr> <tr> <th><?= __('Popularity') . ': ' ?></th> - <td><?= number_format($popularity, 6) ?></td> + <td><?= number_format($popularity, $popularity >= .2 ? 2 : 6) ?></td> </tr> <tr> <th><?= __('First Submitted') . ': ' ?></th> diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php index 8a6e2b44..b2ce8cbe 100644 --- a/web/template/pkgbase_details.php +++ b/web/template/pkgbase_details.php @@ -108,7 +108,7 @@ endif; </tr> <tr> <th><?= __('Popularity') . ': ' ?></th> - <td><?= number_format($popularity, 6) ?></td> + <td><?= number_format($popularity, $popularity >= .2 ? 2 : 6) ?></td> </tr> <tr> <th><?= __('First Submitted') . ': ' ?></th> |