Skip to content

Commit e6c084c

Browse files
committed
Change NumberStyles to float instead of TryParse to float.
1 parent de464a5 commit e6c084c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.OpenApi/Writers/SpecialCharacterStringExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ internal static string GetYamlCompatibleString(this string input)
189189

190190
// If string can be mistaken as a number, a boolean, or a timestamp,
191191
// wrap it in quote to indicate that this is indeed a string, not a number, a boolean, or a timestamp
192-
if (float.TryParse(input, NumberStyles.Any, CultureInfo.InvariantCulture, out var _) ||
192+
if (decimal.TryParse(input, NumberStyles.Float, CultureInfo.InvariantCulture, out var _) ||
193193
bool.TryParse(input, out var _) ||
194194
DateTime.TryParse(input, out var _))
195195
{

0 commit comments

Comments
 (0)