nl_tokens: / * Convert a number and units to a number of bytes . The units can either be included as a suffix for the number or are the power of 1024 .
pl_tokens: function valueAndUnitsToSize ( sizeValue , sizeUnits ) { var sizeBytes = sizeValue ; var match , i , suffixes = 'bkMGT' ; if ( parseFloat ( sizeValue ) > 0 ) { sizeBytes = parseFloat ( sizeValue ) ; /* parse suffix */ match = sizeValue . match ( new RegExp ( '^\\s*[0-9.]+\\s*([' + suffixes + '])' , 'i' ) ) ; if ( match && <mask> . length > 1 ) { for ( sizeUnits = 0 ; sizeUnits < suffixes . length ; sizeUnits += 1 ) { if ( match [ 1 ] . toLowerCase ( ) === suffixes [ sizeUnits ] . toLowerCase ( ) ) { break ; } } } for ( i = 0 ; i < parseInt ( sizeUnits , 10 ) ; i += 1 ) { sizeBytes *= 1024 ; } sizeBytes = parseInt ( sizeBytes , 10 ) ; } return sizeBytes ; }