From 45a104f9c03269fe77bb296335ca8378e96999d4 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 12 Apr 2018 01:48:16 +0900 Subject: [PATCH] =?UTF-8?q?padString=EC=97=90=20=EB=AC=B8=EC=9E=90?= =?UTF-8?q?=EC=97=B4=20=EB=84=88=EB=B9=84=EA=B0=80=20=EC=9B=90=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EA=B8=B8=EC=9D=B4=EB=B3=B4=EB=8B=A4=20=EA=B8=B8?= =?UTF-8?q?=EB=95=8C=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95=20=EB=AA=85?= =?UTF-8?q?=EC=9E=A5=20=EC=9D=BC=EB=9E=8C=20=EB=8D=B0=EC=9D=B4=ED=84=B0?= =?UTF-8?q?=EA=B0=80=20=EB=B9=84=EC=97=88=EC=9D=84=20=EB=95=8C=20=EB=B0=9C?= =?UTF-8?q?=EC=83=9D=ED=95=98=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_bestGeneral.php | 7 +++++-- src/sammo/StringUtil.php | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index bb24239f..2ae7ebc4 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -179,10 +179,13 @@ for ($i=0; $i < 21; $i++) { echo ""; for ($k=0; $k < 10; $k++) { - if ($i == 5 || $i == 7 || $i == 20) { + if($data[$k] === '-'){ + //do Nothing + } + else if ($i == 5 || $i == 7 || $i == 20) { $data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %"; } - if ($i >= 13 && $i <= 16) { + else if ($i >= 13 && $i <= 16) { $data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %"; } echo "{$data[$k]}"; diff --git a/src/sammo/StringUtil.php b/src/sammo/StringUtil.php index 81d2a1f1..7b0ce9c2 100644 --- a/src/sammo/StringUtil.php +++ b/src/sammo/StringUtil.php @@ -103,6 +103,9 @@ class StringUtil } $textLen = mb_strwidth($str, 'UTF-8'); + if($maxsize <= $textLen){ + return $str; + } $fillTextCnt = intdiv($maxsize - $textLen, $chLen);