Module:Utilities: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m Added helper for checking str is in array |
Fix decimal point stripping |
||
| Line 216: | Line 216: | ||
if value then | if value then | ||
-- Keep only digits (0-9), plus (+), and minus (-) | -- Keep only digits (0-9), plus (+), and minus (-) | ||
value = value:gsub("[^0-9+-]", "") | value = value:gsub("[^0-9+.-]", "") | ||
-- Return empty string if nothing left, otherwise return the filtered value | -- Return empty string if nothing left, otherwise return the filtered value | ||
return value ~= "" and value or variable_name | return value ~= "" and value or variable_name | ||