<commit_before><?php
namespace wcf\system\database\table\column;

/**
 * Abstract implementation of a decimal (data) type for database table columns.
 * 
 * @author	<NAME>
 * @copyright	2001-2019 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\System\Database\Table\Column
 * @since	5.2
 */
abstract class AbstractDecimalDatabaseTableColumn extends AbstractDatabaseTableColumn implements IDecimalsDatabaseTableColumn {
	use TDecimalsDatabaseTableColumn;
}
<commit_msg>Fix updating decimal fields with default value (#3382)<commit_after><?php
namespace wcf\system\database\table\column;

/**
 * Abstract implementation of a decimal (data) type for database table columns.
 * 
 * @author	<NAME>
 * @copyright	2001-2019 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\System\Database\Table\Column
 * @since	5.2
 */
abstract class AbstractDecimalDatabaseTableColumn extends AbstractDatabaseTableColumn implements IDecimalsDatabaseTableColumn {
	use TDecimalsDatabaseTableColumn;
	
	/**
	 * @inheritDoc
	 */
	public function getDefaultValue() {
		$defaultValue = parent::getDefaultValue();
		if ($defaultValue === null) {
			return $defaultValue;
		}
		
		return number_format($defaultValue, $this->getDecimals() ?? 0, '.', '');
	}
}

{'fraction_non_alphanumeric': 0.10914245216158752, 'fraction_numerical': 0.01771793054571226, 'mean_word_length': 5.192982456140351, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6546582', 'n_tokens_mistral': 440, 'n_tokens_neox': 395, 'n_words': 102}