mirror of
https://github.com/Respect/Validation.git
synced 2024-06-07 16:22:16 +02:00
Merge branch 'scruwi/master' into 2.2
This commit is contained in:
commit
e5223a0913
|
@ -70,6 +70,6 @@ final class Decimal extends AbstractRule
|
|||
return $formatted;
|
||||
}
|
||||
|
||||
return preg_replace('/^(\d.\d)0*/', '$1', $formatted);
|
||||
return preg_replace('/^(\d+\.\d)0*$/', '$1', $formatted);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,10 @@ final class DecimalTest extends RuleTestCase
|
|||
[new Decimal(1), 1.1],
|
||||
[new Decimal(1), '1.3'],
|
||||
[new Decimal(1), 1.50],
|
||||
[new Decimal(1), 10.0],
|
||||
[new Decimal(2), 10.00],
|
||||
[new Decimal(1), 10.50],
|
||||
[new Decimal(2), 10.50],
|
||||
[new Decimal(3), '1.000'],
|
||||
[new Decimal(3), 123456789.001],
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue