extract number or none(text)number Type: (Text) -> @apply Optional(Number)

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

The difference between this function and extract number(..) is that this function gives back an Optional(Number), so rather than giving an error when there is no number, it gives back None. Successfully extracted numbers are wrapped in the opposing Is constructor; see the optional guide.

ExamplesClick an example to insert it
extract number or none("-34.20m")Optional\Is(-34.2)
extract number or none("£17,000,000")Optional\Is(17000000)
extract number or none("The 6 cats")Optional\Is(6)
extract number or none("2 and 2 makes 4")Optional\None
extract number or none("Two")Optional\None