getnum plugin
Posted: February 16th, 2007, 12:21 pm
A plugin for extracting the first number that appears in a string of text.
his is a very simple plugin that uses only 1 function. function 1 reads a text string and searches for the first number in that string. It returns a substring beginning with the first number that contains only numeric values (or the '.' character, to allow decimal numbers).
For example:
$dll(getnum,1,test1234test,)
will return 1234.
$dll(getnum,1,"now at 56.3%",)
will return 56.3, which can then be passed to, for example, a bar graph.
Hope it is useful.
his is a very simple plugin that uses only 1 function. function 1 reads a text string and searches for the first number in that string. It returns a substring beginning with the first number that contains only numeric values (or the '.' character, to allow decimal numbers).
For example:
$dll(getnum,1,test1234test,)
will return 1234.
$dll(getnum,1,"now at 56.3%",)
will return 56.3, which can then be passed to, for example, a bar graph.
Hope it is useful.