mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 19:53:44 +00:00
Remove floats.
This commit is contained in:
@@ -85,7 +85,7 @@ class UpdateRequest extends FormRequest
|
||||
'notes',
|
||||
];
|
||||
|
||||
$this->floatFields = [
|
||||
$this->floatFields = [ // not really floats, for validation.
|
||||
'amount',
|
||||
'foreign_amount',
|
||||
];
|
||||
@@ -406,8 +406,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;
|
||||
|
@@ -46,9 +46,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;
|
||||
|
@@ -47,9 +47,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;
|
||||
|
Reference in New Issue
Block a user