Table of Contents

Method GetFloatValue

Namespace
SharpVectors.Dom.Css
Assembly
SharpVectors.Core.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.

double GetFloatValue(CssPrimitiveType unitType)

Parameters

unitType CssPrimitiveType

A unit code to get the float value. The unit code can only be a float unit type (i.e. NUMBER, PERCENTAGE, EMS, EXS, PX, CM, MM, IN, PT, PC, DEG, RAD, GRAD, MS, S, HZ, KHZ, 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 or if the float value can't be converted into the specified unit.