Fix ClosedXML cell parsing
This commit is contained in:
parent
21e29dcc60
commit
bde42cbe52
|
|
@ -232,18 +232,8 @@ public sealed class ParcelamentosImportService
|
||||||
{
|
{
|
||||||
if (col <= 0) return "";
|
if (col <= 0) return "";
|
||||||
var cell = ws.Cell(row, col);
|
var cell = ws.Cell(row, col);
|
||||||
var value = cell.Value;
|
if (cell.IsEmpty()) return "";
|
||||||
if (value == null) return "";
|
return (cell.GetValue<string>() ?? "").Trim();
|
||||||
|
|
||||||
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()
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ParseParcelas(string? qtParcelas, out int? parcelaAtual, out int? totalParcelas)
|
private static void ParseParcelas(string? qtParcelas, out int? parcelaAtual, out int? totalParcelas)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue