I have a script configuration where the user can enter values as an absolute value or a percentage value.
Absolute values are written as a value between 0.0 and 1.0, while a percentage value is written as from 0 to 100.
How can I distinguish 1 from 1.0? If I used strings, then this is not a problem for sure ... I would like this configuration to be simple and not have to rely on strings.
Is this even possible?
REFERENCE:
a = 1
b = 1.0
How to say that adoes not belong to the type b.
EDIT
The configuration file looks something like this:
local config = {}
-- A lot of comments describing how to configure
config.paramA = 1
config.paramB = 1.0
return config
In my script processing, I read the configuration files as follows:
config = require 'MyConfigFile'
config.paramA
config.paramB