ZVON > References > DOM2 Reference

getFloatValue (method )

Owning interface and usage:  
CSSPrimitiveValue.getFloatValue(unitType)

Member of these other interfaces:  
none

Description:  
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.

Parameters:  
unsigned unitType  -  A 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:  
float -  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.