mirror of
https://github.com/minetest-mods/technic.git
synced 2025-07-02 08:10:36 +02:00
Better number formating
Is it 120000 or 1200000?
This commit is contained in:
@ -142,7 +142,7 @@ function technic.register_battery_box(data)
|
||||
.."^[lowpart:"..charge_percent
|
||||
..":technic_power_meter_fg.png]")
|
||||
|
||||
local infotext = S("%s Battery Box: %d/%d"):format(tier,
|
||||
local infotext = technic.format(S("%s Battery Box: %e/%e"), tier,
|
||||
current_charge, max_charge)
|
||||
if eu_input == 0 then
|
||||
infotext = S("%s Idle"):format(infotext)
|
||||
|
@ -28,7 +28,7 @@ function technic.register_solar_array(data)
|
||||
local charge_to_give = math.floor((light + pos.y) * data.power)
|
||||
charge_to_give = math.max(charge_to_give, 0)
|
||||
charge_to_give = math.min(charge_to_give, data.power * 50)
|
||||
meta:set_string("infotext", S("%s Active"):format(machine_name).." ("..charge_to_give.."EU)")
|
||||
meta:set_string("infotext", technic.format(S("%s Active (%e EU)"), machine_name, charge_to_give))
|
||||
meta:set_int(tier.."_EU_supply", charge_to_give)
|
||||
else
|
||||
meta:set_string("infotext", S("%s Idle"):format(machine_name))
|
||||
|
Reference in New Issue
Block a user