Skip to content

Commit 41e899f

Browse files
Refactor method
Use `Convert.ToString()` instead of a format string.
1 parent 6c00eab commit 41e899f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/OpenApi/src/Extensions/JsonNodeSchemaExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ internal static void ApplyValidationAttributes(this JsonNode schema, IEnumerable
9696
? CultureInfo.InvariantCulture
9797
: CultureInfo.CurrentCulture;
9898

99-
var minString = string.Format(targetCulture, "{0}", rangeAttribute.Minimum);
100-
var maxString = string.Format(targetCulture, "{0}", rangeAttribute.Maximum);
99+
var minString = Convert.ToString(rangeAttribute.Minimum, targetCulture);
100+
var maxString = Convert.ToString(rangeAttribute.Maximum, targetCulture);
101101

102102
if (decimal.TryParse(minString, NumberStyles.Any, targetCulture, out var minDecimal))
103103
{

0 commit comments

Comments
 (0)