@@ -83,11 +83,16 @@ public static string ToUserFriendlyBytesLabel(this int bytes)
8383 /// <param name="number">The number to format</param>
8484 /// <returns>String representation of the formatted number</returns>
8585 public static string ToKiloFormat ( this int number )
86+ {
87+ return ToKiloFormat ( ( long ) number ) ;
88+ }
89+
90+ public static string ToKiloFormat ( this long number )
8691 {
8792 // To avoid overflow (with Math.Abs()). 1 difference won't make a difference in the simplified format :)
88- if ( number == int . MinValue )
93+ if ( number == long . MinValue )
8994 {
90- number = - 1 * int . MaxValue ;
95+ number = - 1 * long . MaxValue ;
9196 }
9297
9398 if ( Math . Abs ( number ) < 1000 )
@@ -97,9 +102,10 @@ public static string ToKiloFormat(this int number)
97102
98103 var powers = new [ ]
99104 {
100- new { Value = 1_000_000_000f , Unit = 'B' } ,
101- new { Value = 1_000_000f , Unit = 'M' } ,
102- new { Value = 1_000f , Unit = 'K' }
105+ new { Value = 1_000_000_000_000f , Unit = 'T' } ,
106+ new { Value = 1_000_000_000f , Unit = 'B' } ,
107+ new { Value = 1_000_000f , Unit = 'M' } ,
108+ new { Value = 1_000f , Unit = 'K' }
103109 } ;
104110
105111 return powers
0 commit comments