ParameterDTO: Add micro unit prefix

This commit is contained in:
Frank Fenor 2024-03-31 11:39:38 +02:00
parent 283ec725d6
commit 1a66ef1cfe
No known key found for this signature in database
GPG key ID: E6B5029FCCE96376

View file

@ -137,7 +137,7 @@ class ParameterDTO
*/
public static function splitIntoValueAndUnit(string $value): ?array
{
if (preg_match('/^(?<value>-?[0-9\.]+)\s*(?<unit>[%Ω°℃a-z_\/]+\s?\w{0,4})$/iu', $value, $matches)) {
if (preg_match('/^(?<value>-?[0-9\.]+)\s*(?<unit>[%Ωµ°℃a-z_\/]+\s?\w{0,4})$/iu', $value, $matches)) {
$value = $matches['value'];
$unit = $matches['unit'];