Skip to content

Commit

Permalink
CSV import: save cents to db as well
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-staab committed Jun 6, 2024
1 parent a937429 commit 11b149c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Livewire/TransactionImportWire.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,11 @@ public function updatedMapping() : void
public function formatDataDb(string|int $value, string $db_col_name): int|string
{
$type = $this->db_col_types[$db_col_name];
//if($type === 'decimal') dd([$value, (float) $value,$db_col_name]);
return match ($type){
'integer' => (int) $value,
'date' => guessCarbon($value, 'Y-m-d'),
'decimal' => (float) $value,
'decimal' => $value, // no casting needed, string is expected
default => $value,
};
}
Expand Down

0 comments on commit 11b149c

Please sign in to comment.