Gerillass
v2.1.0Type: Function
convertToNumber();
Parses a string of digits into a number.
Arguments
| Name | Type | Description |
|---|---|---|
$value | string | Accepts a string containing only digits. |
Examples
A numeric string turned into a number you can do arithmetic with.
.column {
width: convertToNumber("50") * 1%;
}.column {
width: 50%;
}What it refuses
Arguments are checked, so a wrong value stops the build with a message instead of quietly producing the wrong CSS.
.column {
width: convertToNumber(50) * 1%;
}Error: `50` is not a valid $value for `convertToNumber`. Pass a string made only of digits, such as `"42"`.