Template:GetNumber

From ropewiki.com
Jump to navigation Jump to search

This is the "GetNumber" template. It extracts a character, checks if it's a numeric digit, if it is returns it, otherwise returns null if prevdigit is null, it will return null. this is to make sure we can read 3 digits out of "1-3" and still come back with "1" not "13" It will handle numbers up to 5 digits 10000'=>10000 It will truncate decimal numbers: 10.5 => 10 It will also properly handle negative numbers: -3 => -3 (3)=>-3 It should be called in the following format:

{{GetNumber
|string
}}

Edit the page to see the template text.