mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 08:56:48 +01:00
Risoluzione di un bug sulla conversione delle date in numeri
This commit is contained in:
parent
a65fccf6b8
commit
88d3e6d645
@ -144,6 +144,18 @@ class Formatter
|
|||||||
*/
|
*/
|
||||||
public function parseNumber($value)
|
public function parseNumber($value)
|
||||||
{
|
{
|
||||||
|
if ($value[0] == '+' || $value[0] == '-') {
|
||||||
|
$sign = $value[0];
|
||||||
|
$value = substr($value, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Controllo sull'effettiva natura del numero
|
||||||
|
if (!ctype_digit(str_replace(array_values($this->getNumberSeparators()), '', $value))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$value = $sign.$value;
|
||||||
|
|
||||||
if (is_object($this->numberFormatter)) {
|
if (is_object($this->numberFormatter)) {
|
||||||
$result = $this->numberFormatter->parse($value);
|
$result = $this->numberFormatter->parse($value);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user