mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
fix for issue that decimal number are exported to excel as strings (#1425)
* fix export to excel issue with decimals * add comment
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Data.SqlTypes;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
@@ -174,9 +175,16 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage
|
|||||||
if (o is TimeSpan) //TimeSpan doesn't have TypeCode
|
if (o is TimeSpan) //TimeSpan doesn't have TypeCode
|
||||||
{
|
{
|
||||||
AddCell((TimeSpan)o);
|
AddCell((TimeSpan)o);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
AddCell(dbCellValue.DisplayValue);
|
// We need to handle SqlDecimal and SqlMoney types here because we can't convert them to .NET types due to different precisons in SQL Server and .NET.
|
||||||
|
else if (o is SqlDecimal || o is SqlMoney)
|
||||||
|
{
|
||||||
|
AddCellBoxedNumber(dbCellValue.DisplayValue);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddCell(dbCellValue.DisplayValue);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user