Category talk:StripToNumbers/testcases

From blackwiki
Revision as of 08:08, 18 July 2015 by blackwiki>SMcCandlish (more tests)
Jump to navigation Jump to search

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
  • Input: -66.6666666666666666666666666666
  • Result: -33.333333333333
  • Input: chickenbutt
  • Result: Lua error in Module:StripToNumbers at line 8: Input did not contain valid numeric data.