factoriolib / flib

A set of high-quality, commonly-used utilities for creating Factorio mods.
https://mods.factorio.com/mod/flib
MIT License
61 stars 15 forks source link

data_util.get_energy_value fails on "3500KW" #59

Closed Soul-Burn closed 7 months ago

Soul-Burn commented 8 months ago

Description

get_energy_value is case sensitive and fails on certain values. Both "k" and "K" should be equal to 1000.

Specifically, the base game roboport-equipment.energy_source.input_flow_limit is equal to "3500KW".

Reproduction

Call data_util.get_energy_value("1KW")

Expected result: 1 and "W".

Actual result: nil