Convert a string value from CSS into a numeric value

css_value_as_numeric(x, percentage_as_fraction = TRUE, ...)

Arguments

x

Character string of a CSS value e.g. "12", "12px", "3em", "47%"

percentage_as_fraction

Should percentages like "12 as a fraction (e.g. 0.12)? Default: TRUE. If FALSE then returns the percentage as a numeric value (e.g. 12)

...

other arguments passed to css_length_as_pixels()

Value

a numeric value as best we can with limited knowledge