set converter function
This commit is contained in:
parent
5c7076199b
commit
42f97d98fb
|
@ -13,7 +13,9 @@ math.randomseed(os.time())
|
|||
-- system options/components
|
||||
local system = {}
|
||||
|
||||
-- initialize client library
|
||||
local inputLib = dofile('inputClient.lua')
|
||||
inputLib.set_converter(options.unit)
|
||||
|
||||
-- initialize components
|
||||
wait_for_components(system)
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
-- mekanismEnergyHelper conversion function
|
||||
-- this gets a pre-made function to convert joules (input values) to provided options.unit
|
||||
local convert_joules = mekanismEnergyHelper[
|
||||
string.format('joulesTo%s', options.unit)
|
||||
string.format('joulesTo%s', 'FE')
|
||||
]
|
||||
|
||||
function set_converter(unit)
|
||||
convert_joules = mekanismEnergyHelper[
|
||||
string.format('joulesTo%s', unit)
|
||||
]
|
||||
end
|
||||
|
||||
-- convert number to compact form (1000 => 1k)
|
||||
function compact_number(number)
|
||||
local units = {'K', 'M', 'G', 'T'}
|
||||
|
|
Loading…
Reference in New Issue
Block a user