Attempt to cast floats immediately in settings saver

This commit is contained in:
David Bomba 2022-03-23 21:06:47 +11:00
parent 49733b155c
commit 130803efd6

View File

@ -193,6 +193,11 @@ trait CompanySettingsSaver
settype($settings->{$key}, 'object');
}
//try casting floats here
if($value == 'float'){
$settings->{$key} = floatval($settings->{$key});
}
/* Handles unset settings or blank strings */
if (! property_exists($settings, $key) || is_null($settings->{$key}) || ! isset($settings->{$key}) || $settings->{$key} == '') {
continue;