Merge pull request #1240 from arknu/decimal-parsing
U4-8365: Fix decimal property value converter to work on non EN-US cultures
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using System.Globalization;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
|
||||
namespace Umbraco.Core.PropertyEditors.ValueConverters
|
||||
{
|
||||
@@ -20,7 +21,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
|
||||
if (sourceString != null)
|
||||
{
|
||||
decimal d;
|
||||
return (decimal.TryParse(sourceString, out d)) ? d : 0M;
|
||||
return (decimal.TryParse(sourceString, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out d)) ? d : 0M;
|
||||
}
|
||||
|
||||
// in the database an a decimal is an a decimal
|
||||
|
||||
Reference in New Issue
Block a user