extract number(text)number Type: (Text) -> Number

Extracts a number from the given text. If there is no number, or two numbers, gives an error.

The difference between this function and from text(..) is that this function will accept and ignore extra text around the number, and deal with comma separators. So whereas from text will give an error on "P65n" because it's not solely a number, this extract number function will return 65.

The function assumes that commas are thousand separators, and dot is the decimal separator. If you need to convert continental European style numbers where the opposite is true, use the replace many function as shown in the last example.

ExamplesClick an example to insert it
extract number("-34.20m")-34.2
extract number("£17,000,000")17000000
extract number("The 6 cats")6
extract number("2 and 2 makes 4")error
extract number("Two")error
extract number(replace many([(find: ".", replace: ","), (find: ",", replace: ".")], "10.449,99"))10449.99Swaps dots and commas