Skip to content

Commit f048cfe

Browse files
Zeegaanelit0451
andauthored
v14: DecimalConverter - add check for integer (#17679)
* Add check for integer * Fix typo --------- Co-authored-by: Elitsa <[email protected]>
1 parent 9cab0e8 commit f048cfe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Umbraco.Core/PropertyEditors/ValueConverters/DecimalValueConverter.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ internal static decimal ParseDecimalValue(object? source)
3737
return Convert.ToDecimal(sourceDouble);
3838
}
3939

40+
// is it an integer?
41+
if (source is int sourceInteger)
42+
{
43+
return Convert.ToDecimal(sourceInteger);
44+
}
45+
4046
// is it a string?
4147
if (source is string sourceString)
4248
{

0 commit comments

Comments
 (0)