def siParse(s, regex=FLOAT_REGEX):
 s = asUnicode(s)
 m = regex.match(s)
 if (m is None):
  raise ValueError(('Cannot parse number "%s"' % s))
 try:
  sip = m.group('siPrefix')
 except IndexError:
  sip = ''
 try:
  suf = m.group('suffix')
 except IndexError:
  suf = ''
 return (m.group('number'), ('' if (sip is None) else sip), ('' if (suf is None) else suf))

def siParse ( s , regex = FLOAT_REGEX ) : s = asUnicode ( s ) m = regex . match ( s ) if ( m is None ) : raise ValueError ( ( 'Cannot parse number "%s"' % s ) ) try : sip = m . group ( 'siPrefix' ) except IndexError : sip = '' try : suf = m . group ( 'suffix' ) except IndexError : suf = '' return ( m . group ( 'number' ) , ( '' if ( sip is None ) else sip ) , ( '' if ( suf is None ) else suf ) )
convert a value written in si notation to a tuple .