v14: DecimalConverter - add check for integer (#17679)
* Add check for integer * Fix typo --------- Co-authored-by: Elitsa <elm@umbraco.dk>
This commit is contained in:
@@ -37,6 +37,12 @@ public class DecimalValueConverter : PropertyValueConverterBase
|
||||
return Convert.ToDecimal(sourceDouble);
|
||||
}
|
||||
|
||||
// is it an integer?
|
||||
if (source is int sourceInteger)
|
||||
{
|
||||
return Convert.ToDecimal(sourceInteger);
|
||||
}
|
||||
|
||||
// is it a string?
|
||||
if (source is string sourceString)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user