mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
small fix in math for battery capacity
This commit is contained in:
parent
14eb4aff0f
commit
eb80986cdc
10
inxi
10
inxi
|
@ -4071,11 +4071,9 @@ get_battery_data()
|
||||||
}
|
}
|
||||||
$1 ~ /^POWER_SUPPLY_ENERGY_FULL_DESIGN$/ {
|
$1 ~ /^POWER_SUPPLY_ENERGY_FULL_DESIGN$/ {
|
||||||
charge_full_design = $NF / 1000000
|
charge_full_design = $NF / 1000000
|
||||||
charge_full_design = sprintf( "%.1f", charge_full_design )
|
|
||||||
}
|
}
|
||||||
$1 ~ /^POWER_SUPPLY_ENERGY_FULL$/ {
|
$1 ~ /^POWER_SUPPLY_ENERGY_FULL$/ {
|
||||||
charge_full = $NF / 1000000
|
charge_full = $NF / 1000000
|
||||||
charge_full = sprintf( "%.1f", charge_full )
|
|
||||||
}
|
}
|
||||||
$1 ~ /^POWER_SUPPLY_ENERGY_NOW$/ {
|
$1 ~ /^POWER_SUPPLY_ENERGY_NOW$/ {
|
||||||
charge_now = $NF / 1000000
|
charge_now = $NF / 1000000
|
||||||
|
@ -4083,7 +4081,7 @@ get_battery_data()
|
||||||
}
|
}
|
||||||
$1 ~ /^POWER_SUPPLY_CHARGE_FULL_DESIGN$/ {
|
$1 ~ /^POWER_SUPPLY_CHARGE_FULL_DESIGN$/ {
|
||||||
charge_full_design = $NF / 100000
|
charge_full_design = $NF / 100000
|
||||||
charge_full_design = sprintf( "%.1f", charge_full_design )
|
|
||||||
}
|
}
|
||||||
$1 ~ /^POWER_SUPPLY_CHARGE_FULL$/ {
|
$1 ~ /^POWER_SUPPLY_CHARGE_FULL$/ {
|
||||||
charge_full = $NF / 100000
|
charge_full = $NF / 100000
|
||||||
|
@ -4119,6 +4117,12 @@ get_battery_data()
|
||||||
of_orig=100*charge_full/charge_full_design
|
of_orig=100*charge_full/charge_full_design
|
||||||
of_orig = sprintf( "%.0f%", of_orig )
|
of_orig = sprintf( "%.0f%", of_orig )
|
||||||
}
|
}
|
||||||
|
if (charge_full_design != "" ){
|
||||||
|
charge_full_design = sprintf( "%.1f", charge_full_design )
|
||||||
|
}
|
||||||
|
if ( charge_full != "" ){
|
||||||
|
charge_full = sprintf( "%.1f", charge_full )
|
||||||
|
}
|
||||||
entry = name "," status "," present "," chemistry "," cycles "," voltage_min_design "," voltage_now ","
|
entry = name "," status "," present "," chemistry "," cycles "," voltage_min_design "," voltage_now ","
|
||||||
entry = entry power_now "," charge_full_design "," charge_full "," charge_now "," capacity ","
|
entry = entry power_now "," charge_full_design "," charge_full "," charge_now "," capacity ","
|
||||||
entry = entry capacity_level "," of_orig "," model "," company "," serial "," location
|
entry = entry capacity_level "," of_orig "," model "," company "," serial "," location
|
||||||
|
|
Loading…
Reference in a new issue