Add default_value() function
- Adds new function on the library.:
default_value(value, standard)If the value is NULL, the result of this function is the standard, otherwise, the result is the value.
This function accept both integer, float, string and boolean types. (C++ overloading for the win)
Some success test samples: ✅
default_value(10, 1)
default_value(NULL, 1)
default_value(10.4, 1.01)
default_value(NULL, 1.01)
default_value("filled", "default")
default_value(NULL, "default")
default_value(false, true)
default_value(NULL, true)Some failure test samples: 🚫
default_value(1, 4.5)
default_value(4.5, "string")
default_value("string", true)
default_value(true, 1)