mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 12:11:19 +00:00
Clean up requests
This commit is contained in:
@@ -64,6 +64,25 @@ trait ConvertsDataTypes
|
||||
return (int) $this->get($field);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return floating value.
|
||||
*
|
||||
* @param string $field
|
||||
*
|
||||
* @return float|null
|
||||
*/
|
||||
protected function float(string $field): ?float
|
||||
{
|
||||
$res = $this->get($field);
|
||||
if (null === $res) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (float) $res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse and clean a string, but keep the newlines.
|
||||
*
|
||||
|
Reference in New Issue
Block a user