mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-02 13:59:30 -05:00
Use parse_decimal in decimal validation (#4152)
This commit is contained in:
@@ -140,22 +140,6 @@ class OSPOSRules
|
||||
*/
|
||||
public function decimal_locale(string $candidate, ?string &$error = null): bool
|
||||
{
|
||||
$validation = Services::validation();
|
||||
|
||||
$validation->setRules([
|
||||
'candidate' => 'decimal'
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'candidate' => $candidate
|
||||
];
|
||||
|
||||
if (!$validation->run($data))
|
||||
{
|
||||
$error = $validation->getErrors();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return parse_decimals($candidate) !== false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user