file size only one decimal
This commit is contained in:
		
							parent
							
								
									53969946d2
								
							
						
					
					
						commit
						b08a527199
					
				@ -1,6 +1,6 @@
 | 
			
		||||
function sizeToReadable(size: number): string {
 | 
			
		||||
	const i = Math.floor(Math.log(size) / Math.log(1024))
 | 
			
		||||
	return (size / Math.pow(1024, i)).toFixed(2) + " " + ["B", "kB", "MB", "GB", "TB"][i]
 | 
			
		||||
	return (size / Math.pow(1024, i)).toFixed(1) + " " + ["B", "kB", "MB", "GB", "TB"][i]
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user