We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e6071cd commit 7998adaCopy full SHA for 7998ada
elements/number.php
@@ -214,6 +214,24 @@ protected function typeCastValue()
214
$this->value = (float) $numberString;
215
}
216
// }}}
217
+
218
+ // {{{ isEmpty()
219
+ /**
220
+ * @brief custom empty check
221
+ *
222
+ * Number specific empty check (allows for zero int/float values)
223
224
+ * @return bool empty-check result
225
+ **/
226
+ public function isEmpty() {
227
+ return (
228
+ empty($this->value)
229
+ && $this->value !== 0
230
+ && $this->value !== .0
231
+ );
232
+ }
233
+ // }}}
234
235
236
237
/* vim:set ft=php sw=4 sts=4 fdm=marker et : */
0 commit comments