Skip to content

Commit 09aee23

Browse files
committed
Support integer formatting with specifiers D and B
1 parent 63d5f60 commit 09aee23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/GitVersion.Core/Formatting/NumericFormatter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public override bool TryFormat(object? value, string format, CultureInfo culture
2020
return true;
2121
}
2222

23-
// Hexadecimal formatting
24-
if (format.StartsWith("X", StringComparison.OrdinalIgnoreCase) && int.TryParse(s, NumberStyles.Integer, cultureInfo, out var hex))
23+
// Integer formatting with precision specifier
24+
if ("BDX".Contains(char.ToUpperInvariant(format[0])) && int.TryParse(s, NumberStyles.Integer, cultureInfo, out var hex))
2525
{
2626
result = hex.ToString(format, cultureInfo);
2727
return true;

0 commit comments

Comments
 (0)