We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0bb381d commit 2bf72c7Copy full SHA for 2bf72c7
1 file changed
Format/Str.php
@@ -420,6 +420,19 @@ public function toBool(): bool
420
}
421
return ($this->value !== "false" && strlen($this->value));
422
423
+
424
+ /**
425
+ * Compare value to value
426
+ * @param string|int|float|bool|null $compare
427
+ * @return bool
428
+ */
429
+ public function compare(string|int|float|bool|null $compare): bool
430
+ {
431
+ if(is_numeric($this->value)) {
432
+ return ((float)$this->value > 0);
433
+ }
434
+ return ($this->value === $compare);
435
436
437
/**
438
* To int value
0 commit comments