trying hard disk size output with decimal place, one, for smaller usb drives

This commit is contained in:
inxi-svn 2008-11-08 06:27:48 +00:00
parent 78c1b52da1
commit bfcc6035eb

4
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.4.5 #### version: 0.4.6
#### Date: November 7 2008 #### Date: November 7 2008
######################################################################## ########################################################################
#### inxi is a fork of infobash, the original bash sys info script by locsmif #### inxi is a fork of infobash, the original bash sys info script by locsmif
@ -1169,7 +1169,7 @@ get_hdd_data_basic()
driveSize = $(NF - 1)*1024/1000**3 driveSize = $(NF - 1)*1024/1000**3
gsub(/,/, " ", driveSize) gsub(/,/, " ", driveSize)
gsub(/^ +| +$/, "", driveSize) gsub(/^ +| +$/, "", driveSize)
printf( $NF",%dGB,\n", driveSize ) printf( $NF",%.1fGB,\n", driveSize )
} }
# See http://lanana.org/docs/device-list/devices-2.6+.txt for major numbers used below # See http://lanana.org/docs/device-list/devices-2.6+.txt for major numbers used below
$1 ~ /^(3|22|33|8)$/ && $2 % 16 == 0 {size+=$3} $1 ~ /^(3|22|33|8)$/ && $2 % 16 == 0 {size+=$3}