Method GetFloatValue
- Namespace
- SharpVectors.Dom.Css
- Assembly
- SharpVectors.Css.dll
GetFloatValue(CssPrimitiveType)
This method is used to get a float value in a specified unit. If this CSS value doesn't contain a float value or can't be converted into the specified unit, a DomException is raised
public override double GetFloatValue(CssPrimitiveType unitType)
Parameters
unitType
CssPrimitiveTypeA unit code to get the float value. The unit code can only be a float unit type (i.e. CSS_NUMBER, CSS_PERCENTAGE, CSS_EMS, CSS_EXS, CSS_PX, CSS_CM, CSS_MM, CSS_IN, CSS_PT, CSS_PC, CSS_DEG, CSS_RAD, CSS_GRAD, CSS_MS, CSS_S, CSS_HZ, CSS_KHZ, CSS_DIMENSION).
Returns
- double
The float value in the specified unit.
Exceptions
- DomException
INVALID_ACCESS_ERR:
Raised if the CSS value doesn't contain a float value.