From bde42cbe522d044fb4318aebbabcfdce0b3348ca Mon Sep 17 00:00:00 2001 From: Eduardo Lopes <155753879+eduardolopesx03@users.noreply.github.com> Date: Mon, 2 Feb 2026 16:18:12 -0300 Subject: [PATCH] Fix ClosedXML cell parsing --- Services/ParcelamentosImportService.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Services/ParcelamentosImportService.cs b/Services/ParcelamentosImportService.cs index 5f532d9..b092aa9 100644 --- a/Services/ParcelamentosImportService.cs +++ b/Services/ParcelamentosImportService.cs @@ -232,18 +232,8 @@ public sealed class ParcelamentosImportService { if (col <= 0) return ""; var cell = ws.Cell(row, col); - var value = cell.Value; - if (value == null) return ""; - - return value switch - { - double d => d.ToString(CultureInfo.InvariantCulture), - decimal d => d.ToString(CultureInfo.InvariantCulture), - float f => f.ToString(CultureInfo.InvariantCulture), - int i => i.ToString(CultureInfo.InvariantCulture), - long l => l.ToString(CultureInfo.InvariantCulture), - _ => (value.ToString() ?? "").Trim() - }; + if (cell.IsEmpty()) return ""; + return (cell.GetValue() ?? "").Trim(); } private static void ParseParcelas(string? qtParcelas, out int? parcelaAtual, out int? totalParcelas)