private Tuple < Number , String > parse ( final String value ) { Matcher matcher = SIZE . matcher ( value ) ; if ( matcher . find ( ) ) { String number = matcher . group ( 1 ) ; String unit = matcher . group ( _3 ) ; boolean round = get ( "css.round" ) ; Number num = Double . parseDouble ( number ) ; return new Tuple ( round ? Math . round ( num . doubleValue ( ) ) : num , unit ) ; } return null ; }
Parse a css size unit value like 10px or 18 . 919px and optionally round the value to the closest integer .