File tree 2 files changed +9
-8
lines changed
Modules/DirectoryBrowsing/Provider
Testing/Acceptance/Modules/DirectoryBrowsing
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using System . Globalization ;
2
3
3
4
namespace GenHTTP . Modules . DirectoryBrowsing . Provider
4
5
{
@@ -22,19 +23,19 @@ public static string Format(ulong? bytes)
22
23
23
24
if ( bytes > TERABYTES )
24
25
{
25
- return Math . Round ( b / TERABYTES , 2 ) + " TB" ;
26
+ return Math . Round ( b / TERABYTES , 2 ) . ToString ( CultureInfo . InvariantCulture ) + " TB" ;
26
27
}
27
28
if ( bytes > GIGABYTES )
28
29
{
29
- return Math . Round ( b / GIGABYTES , 2 ) + " GB" ;
30
+ return Math . Round ( b / GIGABYTES , 2 ) . ToString ( CultureInfo . InvariantCulture ) + " GB" ;
30
31
}
31
32
else if ( bytes > MEGABYTES )
32
33
{
33
- return Math . Round ( b / MEGABYTES , 2 ) + " MB" ;
34
+ return Math . Round ( b / MEGABYTES , 2 ) . ToString ( CultureInfo . InvariantCulture ) + " MB" ;
34
35
}
35
36
else if ( bytes > KILOBYTES )
36
37
{
37
- return Math . Round ( b / KILOBYTES , 2 ) + " KB" ;
38
+ return Math . Round ( b / KILOBYTES , 2 ) . ToString ( CultureInfo . InvariantCulture ) + " KB" ;
38
39
}
39
40
40
41
return $ "{ bytes } Bytes";
Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ public void TestFormatting()
13
13
{
14
14
Assert . AreEqual ( "512 Bytes" , FileSizeFormatter . Format ( 512 ) ) ;
15
15
16
- Assert . AreEqual ( "2, 78 KB" , FileSizeFormatter . Format ( 2842 ) ) ;
16
+ Assert . AreEqual ( "2. 78 KB" , FileSizeFormatter . Format ( 2842 ) ) ;
17
17
18
- Assert . AreEqual ( "2, 78 MB" , FileSizeFormatter . Format ( 2842 * 1024 ) ) ;
18
+ Assert . AreEqual ( "2. 78 MB" , FileSizeFormatter . Format ( 2842 * 1024 ) ) ;
19
19
20
- Assert . AreEqual ( "2, 78 GB" , FileSizeFormatter . Format ( 2842L * 1024 * 1024 ) ) ;
20
+ Assert . AreEqual ( "2. 78 GB" , FileSizeFormatter . Format ( 2842L * 1024 * 1024 ) ) ;
21
21
22
- Assert . AreEqual ( "2, 78 TB" , FileSizeFormatter . Format ( 2842L * 1024 * 1024 * 1024 ) ) ;
22
+ Assert . AreEqual ( "2. 78 TB" , FileSizeFormatter . Format ( 2842L * 1024 * 1024 * 1024 ) ) ;
23
23
}
24
24
25
25
}
You can’t perform that action at this time.
0 commit comments