We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3212872 commit e48a4b2Copy full SHA for e48a4b2
1 file changed
src/IGLib.Core/Console/Validation/Implementations/StringParsing/Parsers.cs
@@ -38,4 +38,25 @@ public bool TryParse(string text, out int value) =>
38
}
39
40
41
+
42
+ internal sealed class DecimalStringParser : IStringParser<decimal>
43
+ {
44
+ private readonly IFormatProvider _formatProvider;
45
46
+ public DecimalStringParser(IFormatProvider formatProvider)
47
48
+ _formatProvider = formatProvider;
49
+ }
50
51
+ public bool TryParse(string text, out decimal value) =>
52
+ decimal.TryParse(
53
+ text,
54
+ NumberStyles.Number,
55
+ _formatProvider,
56
+ out value);
57
58
59
60
61
62
0 commit comments