6
0
Fork 0
release
李静 2021-12-14 09:40:56 +08:00
parent a017e932ba
commit b9d657ad45
1 changed files with 2 additions and 2 deletions

View File

@ -13,9 +13,9 @@ class Numeric
public static function trimZero($value) public static function trimZero($value)
{ {
if (is_numeric($value) && strpos($value, '.') !== false) { if (is_numeric($value) && strpos($value, '.') !== false) {
return rtrim(rtrim($value, '0'), '.'); $value = rtrim(trim($value, '0'), '.');
} }
return $value; return $value ?: '0';
} }
} }