Jump to content

Module:Strip to numbers/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by SMcCandlish (talk | contribs) at 08:02, 18 July 2015 (test). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Strip units from CSS values (why I want this)

  • Input: -12em, 34px, 56%, "78.9x0"
  • Result: -12

Find numbers in a bunch of stuff

  • Input: SDks]df9s>dfjklasdfk9kasdfkasdkie0kmc'@(aks
  • Result: 9

Halve number found in stuff

  • Input: foobarbaz50%blahblahblah
  • Result: 25