module Sass::Script::Functions
def percentage(value)
-
(ArgumentError)
- If `value` isn't a unitless number
Returns:
-
(Number)
- The percentage
Parameters:
-
value
(Number
) -- The decimal number to convert to a percentage
def percentage(value) unless value.is_a?(Sass::Script::Number) && value.unitless? raise ArgumentError.new("#{value.inspect} is not a unitless number") end Sass::Script::Number.new(value.value * 100, ['%']) end