diff --git a/src/Resolvers/DecimalResolver.php b/src/Resolvers/DecimalResolver.php index 8ae66f5..dfba790 100644 --- a/src/Resolvers/DecimalResolver.php +++ b/src/Resolvers/DecimalResolver.php @@ -20,7 +20,11 @@ class DecimalResolver extends Resolver { public function fake(): string { - return '\''.$this->column->field.'\' => fake()->randomFloat(2, 0, 10000),'; + $bracket = Bracket::of($this->column->bracket)->escape(); + + $bracket = empty($bracket) ? '' : ', '.$bracket; + + return '\''.$this->column->field.'\' => fake()->randomFloat('.$bracket.'),'; } public function migration(): string diff --git a/tests/Unit/Resolvers/DecimalResolverTest.php b/tests/Unit/Resolvers/DecimalResolverTest.php index 6203e41..c21c4e0 100644 --- a/tests/Unit/Resolvers/DecimalResolverTest.php +++ b/tests/Unit/Resolvers/DecimalResolverTest.php @@ -42,7 +42,7 @@ public function test_fake_method_can_working_well(): void { $resolver = new DecimalResolver($this->column); - $this->assertEquals('\''.$resolver->field.'\' => fake()->randomFloat(2, 0, 10000),', $resolver->fake()); + $this->assertEquals('\''.$resolver->field.'\' => fake()->randomFloat(),', $resolver->fake()); } public function test_migration_method_can_working_well(): void