Merge branch 'develop' into 5.8-dev

This commit is contained in:
James Cole
2022-12-27 21:13:42 +01:00
19 changed files with 58 additions and 53 deletions

View File

@@ -88,7 +88,7 @@ class UpdateRequest extends FormRequest
'notes',
];
$this->floatFields = [
$this->floatFields = [ // not really floats, for validation.
'amount',
'foreign_amount',
];
@@ -408,8 +408,7 @@ class UpdateRequest extends FormRequest
if (array_key_exists($fieldName, $transaction)) {
$value = $transaction[$fieldName];
if (is_float($value)) {
// TODO this effectively limits the max number of decimals in currencies to 14.
$current[$fieldName] = sprintf('%.14f', $value);
$current[$fieldName] = sprintf('%.24f', $value);
}
if (!is_float($value)) {
$current[$fieldName] = (string) $value;

View File

@@ -47,9 +47,8 @@ class PreferenceStoreRequest extends FormRequest
if ('false' === $array['data']) {
$array['data'] = false;
}
// TODO remove float
if (is_numeric($array['data'])) {
$array['data'] = (float) $array['data'];
$array['data'] = (float) $array['data']; // intentional float.
}
return $array;

View File

@@ -48,9 +48,8 @@ class PreferenceUpdateRequest extends FormRequest
if ('false' === $array['data']) {
$array['data'] = false;
}
// TODO remove float
if (is_numeric($array['data'])) {
$array['data'] = (float) $array['data'];
$array['data'] = (float) $array['data']; // intentional float.
}
return $array;