Skip to content

Commit bf8ccb1

Browse files
committed
Use thread CurrencySymbol in filter displays vs. hardcoding $
1 parent 4ef6bac commit bf8ccb1

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

Build/CommonAssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
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.4.2")]
19-
[assembly: AssemblyFileVersion("1.4.2")]
18+
[assembly: AssemblyVersion("1.4.3")]
19+
[assembly: AssemblyFileVersion("1.4.3")]

Griddly.Mvc/GriddlyExtensions.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Linq;
55
using System.Reflection;
66
using System.Text;
7+
using System.Threading;
78
using System.Web;
89
using System.Web.Mvc;
910
using System.Web.Mvc.Html;
@@ -15,6 +16,14 @@ namespace Griddly.Mvc
1516
{
1617
public static class GriddlyExtensions
1718
{
19+
public static string CurrencySymbol
20+
{
21+
get
22+
{
23+
return Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol;
24+
}
25+
}
26+
1827
public static MvcHtmlString Griddly(this HtmlHelper htmlHelper, string actionName)
1928
{
2029
return htmlHelper.Griddly(actionName, null);
@@ -203,7 +212,7 @@ public static string Current(this UrlHelper helper, object routeValues = null, b
203212
// values[value.Key] = (DateTime)value.Value; -- BAD: can't unbox a value type as a different type
204213
values[value.Key] = Convert.ChangeType(value.Value, typeof(DateTime));
205214
else if (t.IsArray || t.IsSubclassOf(typeof(IEnumerable)))
206-
values[value.Key] = string.Join(",", ((IEnumerable)value.Value).Cast<object>());
215+
values[value.Key] = string.Join(",", ((IEnumerable)value.Value).Cast<object>());
207216
}
208217
}
209218

Griddly/Views/Shared/Griddly/GriddlyFilterForm.cshtml

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
@:<div class="input-group input-group-sm">
3232
if (filter.DataType == FilterDataType.Currency)
3333
{
34-
<span class="input-group-addon">$</span>
34+
<span class="input-group-addon">@GriddlyExtensions.CurrencySymbol</span>
3535
}
3636
else if (filter.DataType == FilterDataType.Date)
3737
{
@@ -58,7 +58,7 @@
5858
@:<div class="input-group input-group-sm">
5959
if (filter.DataType == FilterDataType.Currency)
6060
{
61-
<span class="input-group-addon">$</span>
61+
<span class="input-group-addon">@GriddlyExtensions.CurrencySymbol</span>
6262
}
6363
else if (filter.DataType == FilterDataType.Date)
6464
{
@@ -83,7 +83,7 @@
8383
@:<div class="input-group input-group-sm">
8484
if (filter.DataType == FilterDataType.Currency)
8585
{
86-
<span class="input-group-addon">$</span>
86+
<span class="input-group-addon">@GriddlyExtensions.CurrencySymbol</span>
8787
}
8888
else if (filter.DataType == FilterDataType.Date)
8989
{

Griddly/Views/Shared/Griddly/GriddlyFilterInline.cshtml

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
<div class="input-group input-group-sm">
106106
@if (filter.DataType == FilterDataType.Currency)
107107
{
108-
<span class="input-group-addon">$</span>
108+
<span class="input-group-addon">@GriddlyExtensions.CurrencySymbol</span>
109109
}
110110
else if (filter.DataType == FilterDataType.Date)
111111
{
@@ -127,7 +127,7 @@
127127
<div class="input-group input-group-sm">
128128
@if (filter.DataType == FilterDataType.Currency)
129129
{
130-
<span class="input-group-addon">$</span>
130+
<span class="input-group-addon">@GriddlyExtensions.CurrencySymbol</span>
131131
}
132132
else if (filter.DataType == FilterDataType.Date)
133133
{
@@ -147,7 +147,7 @@
147147
<div class="input-group input-group-sm">
148148
@if (filter.DataType == FilterDataType.Currency)
149149
{
150-
<span class="input-group-addon">$</span>
150+
<span class="input-group-addon">@GriddlyExtensions.CurrencySymbol</span>
151151
}
152152
else if (filter.DataType == FilterDataType.Date)
153153
{

0 commit comments

Comments
 (0)