|
@@ -74,7 +74,7 @@ class Product extends Model
|
|
|
{
|
|
{
|
|
|
return Attribute::make(
|
|
return Attribute::make(
|
|
|
get: fn(int|null $value) => (float) $value / 100,
|
|
get: fn(int|null $value) => (float) $value / 100,
|
|
|
- set: fn (float $value) => (int) ($value * 100),
|
|
|
|
|
|
|
+ set: fn (float $value) => (int) round($value * 100),
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -82,7 +82,7 @@ class Product extends Model
|
|
|
{
|
|
{
|
|
|
return Attribute::make(
|
|
return Attribute::make(
|
|
|
get: fn(int|null $value) => (float) $value / 100,
|
|
get: fn(int|null $value) => (float) $value / 100,
|
|
|
- set: fn (float $value) => (int) ($value * 100),
|
|
|
|
|
|
|
+ set: fn (float $value) => (int) round($value * 100),
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -91,7 +91,7 @@ class Product extends Model
|
|
|
{
|
|
{
|
|
|
return Attribute::make(
|
|
return Attribute::make(
|
|
|
get: fn(int|null $value) => (float) $value / 100,
|
|
get: fn(int|null $value) => (float) $value / 100,
|
|
|
- set: fn (float $value) => (int) ($value * 100),
|
|
|
|
|
|
|
+ set: fn (float $value) => (int) round($value * 100),
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|