Dear all,
I am having an issue when indexing the table output of a function.
I needed a physical unit conversion functionality and found the great function below on github:
I needed to make some modifications to output a table instead of string. Now after my minor modifications the function outputs a table with 'value' and 'unit' indices (see the modified function in the attachment). However I cannot index the output table with 'unit' afterwards, it always returns to nil.
I am a beginner in lua and I use it at very basic level so I am not able to understand what the problem is.
I would appreciate if you help me to fix this issue.
Many thanks in advance.
Best,
Hur