Mercurial > hg > mgallery
changeset 249:abcd21b01829
Use floating point formatting for certain DVA values.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 29 Oct 2018 20:32:59 +0200 |
parents | 2656b64c4c04 |
children | 3af3b3f50cb0 |
files | mgtool.php |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mgtool.php Mon Jun 04 00:03:54 2018 +0300 +++ b/mgtool.php Mon Oct 29 20:32:59 2018 +0200 @@ -140,7 +140,7 @@ if (sscanf($val, "%d/%d", $v1, $v2) == 2 && $v2 != 0 && $v1 != 0) { if ($v1 < $v2) - return "1/".($v2 / $v1); + return sprintf("1/%1.1f", $v2 / $v1); else return sprintf("%1.1f", $v1 / $v2); }