@@ -60,13 +60,13 @@ public static string WithEnding(this string str, string ending)
6060
6161 private static readonly Dictionary < string , string > abbreviations = new ( )
6262 {
63- { "KiB" , " KiloByteSymbol" . GetLocalizedResource ( ) } ,
64- { "MiB" , " MegaByteSymbol" . GetLocalizedResource ( ) } ,
65- { "GiB" , " GigaByteSymbol" . GetLocalizedResource ( ) } ,
66- { "TiB" , " TeraByteSymbol" . GetLocalizedResource ( ) } ,
67- { "PiB" , " PetaByteSymbol" . GetLocalizedResource ( ) } ,
68- { "B" , " ByteSymbol" . GetLocalizedResource ( ) } ,
69- { "b" , " ByteSymbol" . GetLocalizedResource ( ) }
63+ { ByteSize . KiloByteSymbol , Strings . KiloByteSymbol . GetLocalizedResource ( ) } ,
64+ { ByteSize . MegaByteSymbol , Strings . MegaByteSymbol . GetLocalizedResource ( ) } ,
65+ { ByteSize . GigaByteSymbol , Strings . GigaByteSymbol . GetLocalizedResource ( ) } ,
66+ { ByteSize . TeraByteSymbol , Strings . TeraByteSymbol . GetLocalizedResource ( ) } ,
67+ { ByteSize . PetaByteSymbol , Strings . PetaByteSymbol . GetLocalizedResource ( ) } ,
68+ { ByteSize . BitSymbol , Strings . ByteSymbol . GetLocalizedResource ( ) } ,
69+ { ByteSize . ByteSymbol , Strings . ByteSymbol . GetLocalizedResource ( ) }
7070 } ;
7171
7272 public static string ConvertSizeAbbreviation ( this string value )
@@ -83,7 +83,7 @@ public static string ConvertSizeAbbreviation(this string value)
8383 public static string ToSizeString ( this long size ) => ByteSize . FromBytes ( size ) . ToSizeString ( ) ;
8484 public static string ToSizeString ( this ulong size ) => ByteSize . FromBytes ( size ) . ToSizeString ( ) ;
8585 public static string ToSizeString ( this decimal size ) => ByteSize . FromBytes ( ( double ) size ) . ToSizeString ( ) ;
86- public static string ToSizeString ( this ByteSize size ) => size . ToBinaryString ( ) . ConvertSizeAbbreviation ( ) ;
86+ public static string ToSizeString ( this ByteSize size ) => size . ToString ( ) . ConvertSizeAbbreviation ( ) ;
8787
8888 public static string ToLongSizeString ( this long size ) => ByteSize . FromBytes ( size ) . ToLongSizeString ( ) ;
8989 public static string ToLongSizeString ( this ulong size ) => ByteSize . FromBytes ( size ) . ToLongSizeString ( ) ;
0 commit comments