Skip to content

Commit 8010ed9

Browse files
992294-Numberformat
1 parent cac3d01 commit 8010ed9

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Solution>
2+
<Project Path="Numberformatforentirerow/Numberformatforentirerow.csproj" />
3+
</Solution>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Syncfusion.XlsIO.Net.Core" Version="31.2.12" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<None Update="Output\*">
16+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
17+
</None>
18+
</ItemGroup>
19+
20+
</Project>

FAQ/Number format for entire row/.NET/Numberformatforentirerow/Numberformatforentirerow/Output/.gitkeep

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Syncfusion.XlsIO;
2+
3+
class Program
4+
{
5+
static void Main(string[] args)
6+
{
7+
using (ExcelEngine excelEngine = new ExcelEngine())
8+
{
9+
IApplication application = excelEngine.Excel;
10+
application.DefaultVersion = ExcelVersion.Xlsx;
11+
IWorkbook workbook = application.Workbooks.Create(1);
12+
IWorksheet worksheet = workbook.Worksheets[0];
13+
14+
worksheet["A1"].Number = 1000.500;
15+
worksheet["B1"].Number = 1234;
16+
worksheet["C1"].Number = 54321.500;
17+
worksheet["D1"].Number = .500;
18+
19+
worksheet["A1"].EntireRow.NumberFormat = "#,##0.0000";
20+
workbook.SaveAs("../../../Output/NumberFormats.xlsx");
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)