use FormatSize
This commit is contained in:
		
							parent
							
								
									afa32b68d1
								
							
						
					
					
						commit
						82512ad3eb
					
				@ -3,6 +3,10 @@ using Hyperic.Sigar;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class Df {
 | 
					public class Df {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private static String FormatSize(ulong value) {
 | 
				
			||||||
 | 
					        return Sigar.FormatSize(value * 1024);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static void Main() {
 | 
					    public static void Main() {
 | 
				
			||||||
        Sigar sigar = new Sigar();
 | 
					        Sigar sigar = new Sigar();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -31,9 +35,9 @@ public class Df {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            System.Console.WriteLine(fs.DevName + "\t" +
 | 
					            System.Console.WriteLine(fs.DevName + "\t" +
 | 
				
			||||||
                                     total + "\t" +
 | 
					                                     FormatSize(total) + "\t" +
 | 
				
			||||||
                                     used + "\t" + 
 | 
					                                     FormatSize(used) + "\t" + 
 | 
				
			||||||
                                     avail + "\t" + 
 | 
					                                     FormatSize(avail) + "\t" + 
 | 
				
			||||||
                                     usePct + "\t" +
 | 
					                                     usePct + "\t" +
 | 
				
			||||||
                                     fs.DirName + "\t" + 
 | 
					                                     fs.DirName + "\t" + 
 | 
				
			||||||
                                     fs.SysTypeName + "/" + fs.TypeName);
 | 
					                                     fs.SysTypeName + "/" + fs.TypeName);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user