Skip to content

Commit f3b3dcd

Browse files
committed
[GH Usage] Changed G for B in KiloFormat
1 parent facdcb7 commit f3b3dcd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/NuGetGallery/Extensions/NumberExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ public static string ToUserFriendlyBytesLabel(this long bytes)
6969
}
7070

7171
/// <summary>
72-
/// Format the number to a 3 digit representation plus a letter to represent the scale (K for kilo, M for mega, or G for giga)
72+
/// Format the number to a 3 digit representation plus a letter to represent the scale (K for kilo, M for mega, or B for billion)
7373
/// </summary>
7474
/// <param name="number"></param>
7575
/// <returns></returns>
7676
public static string ToKiloFormat(this int number)
7777
{
7878
if (number >= 1_000_000_000)
7979
{
80-
return new StringBuilder((number / 1_000_000_000.0f).ToString("F3")) { [4] = 'G' }.ToString();
80+
return new StringBuilder((number / 1_000_000_000.0f).ToString("F3")) { [4] = 'B' }.ToString();
8181
}
8282

8383
if (number >= 100_000_000)

tests/NuGetGallery.Facts/Extensions/NumberExtensionsFacts.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public class TheToKiloFormatMethod
5353
[InlineData(99_990_000, "99.9M")]
5454
[InlineData(100_990_000, "100M")]
5555
[InlineData(999_990_000, "999M")]
56-
[InlineData(1_000_000_000, "1.00G")]
57-
[InlineData(1_999_000_000, "1.99G")]
56+
[InlineData(1_000_000_000, "1.00B")]
57+
[InlineData(1_999_000_000, "1.99B")]
5858
public void FormatsUsingExpectedUnit(int number, string expected)
5959
{
6060
var actual = NumberExtensions.ToKiloFormat(number);

0 commit comments

Comments
 (0)