mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°1202 - Fix History on Decimal. No diff when modify only trailing 0s.
This commit is contained in:
@@ -2736,13 +2736,17 @@ class AttributeDecimal extends AttributeDBField
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string)$proposedValue;
|
||||
return $this->ScalarToSQL($proposedValue);
|
||||
}
|
||||
|
||||
public function ScalarToSQL($value)
|
||||
{
|
||||
assert(is_null($value) || preg_match('/'.$this->GetValidationPattern().'/', $value));
|
||||
|
||||
if (!is_null($value) && ($value !== ''))
|
||||
{
|
||||
$value = sprintf("%01.".$this->Get('decimals')."f", $value);
|
||||
}
|
||||
return $value; // null or string
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user