Module:Strip to numbers/doc explained

Usage

This module extracts very basic numeric data from the input, namely the first match for a contiguous simple number, which may include the negative sign and a decimal, but not (yet) any further complexity, such as exponents, variables, etc.

Its primary function is accepting data like:

Results for each string, respectively:

Use cases

Limitations (serious ones)

See also: Module:StripToNumbers/testcases.

So: when input is a=70% use <nowiki>{{#invoke:StripToNumbers|main|1=a=70%}}</nowiki>

Feel free to expand it to do more things (and to do what it does more robustly if you find a way to break it). Please report problems on the talk page and ping regular editors of the module. It is safest in most cases to expand by adding functions rather than adding features to the main function.

Invocation

Basic usage:

To divide the resulting value by two:

Same as main but returns null if no numbers in string, rather than error (can be used as contains numeric function):

See also