Skip to content

Commit 58b0f55

Browse files
committed
Add option to not export currency symbol
Only force short date on export if "d" format
1 parent 7e98de7 commit 58b0f55

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

Build/CommonAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
//
1616
// You can specify all the values or you can default the Revision and Build Numbers
1717
// by using the '*' as shown below:
18-
[assembly: AssemblyVersion("1.8.4")]
19-
[assembly: AssemblyFileVersion("1.8.4")]
18+
[assembly: AssemblyVersion("1.8.5")]
19+
[assembly: AssemblyFileVersion("1.8.5")]
2020
//[assembly: AssemblyInformationalVersion("1.4.5-editlyalpha2")]

Griddly.Mvc/GriddlyExcelResult.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ public override void ExecuteResult(ControllerContext context)
5858

5959
if (renderedValue as DateTime? != null)
6060
{
61-
cell.Style.Numberformat.Format = "mm/dd/yyyy";
61+
if (columns[x].Format == "d")
62+
cell.Style.Numberformat.Format = "mm/dd/yyyy";
63+
6264
cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
6365
}
6466
else if (columns[x].Format == "c")
6567
{
66-
cell.Style.Numberformat.Format = "\"$\"#,##0.00_);(\"$\"#,##0.00)";
68+
if (GriddlySettings.ExportCurrencySymbol)
69+
cell.Style.Numberformat.Format = "\"" + GriddlyExtensions.CurrencySymbol + "\"#,##0.00_);(\"" + GriddlyExtensions.CurrencySymbol + "\"#,##0.00)";
70+
6771
cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
6872
}
6973
}

Griddly.Mvc/GriddlySettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public abstract class GriddlySettings
2424
public static FilterMode? DefaultInitialFilterMode = FilterMode.Inline;
2525
//public static FilterMode? DefaultAllowedFilterModes = FilterMode.Inline;
2626
public static bool DefaultShowRowSelectCount = true;
27+
public static bool ExportCurrencySymbol = true;
2728

2829
public static Func<GriddlyButton, object> IconTemplate = null;
2930
public static Func<GriddlyResultPage, object> DefaultFooterTemplate = null;

0 commit comments

Comments
 (0)