MCPcopy Index your code
hub / github.com/python-visualization/folium / parse_font_size

Function parse_font_size

folium/utilities.py:456–463  ·  view source on GitHub ↗

Parse a font size value, if number set as px

(value: Union[str, int, float])

Source from the content-addressed store, hash-verified

454
455
456def parse_font_size(value: Union[str, int, float]) -> str:
457 """Parse a font size value, if number set as px"""
458 if isinstance(value, (int, float)):
459 return f"{value}px"
460
461 if (value[-3:] != "rem") and (value[-2:] not in ["em", "px"]):
462 raise ValueError("The font size must be expressed in rem, em, or px.")
463 return value

Callers 3

__init__Method · 0.90

Calls

no outgoing calls

Tested by 2