Mercurial > babel > old > mirror
comparison babel/numbers.py @ 522:0c202a7562ee
Just use the rsplit() since we do not need to support 2.3 in trunk.
author | jruigrok |
---|---|
date | Sat, 05 Mar 2011 14:43:28 +0000 |
parents | 07855b5aa0b8 |
children | e93f68837913 |
comparison
equal
deleted
inserted
replaced
521:e4d08b21c49b | 522:0c202a7562ee |
---|---|
392 if '@' in number: | 392 if '@' in number: |
393 if '.' in number and '0' in number: | 393 if '.' in number and '0' in number: |
394 raise ValueError('Significant digit patterns can not contain ' | 394 raise ValueError('Significant digit patterns can not contain ' |
395 '"@" or "0"') | 395 '"@" or "0"') |
396 if '.' in number: | 396 if '.' in number: |
397 #integer, fraction = number.rsplit('.', 1) | 397 integer, fraction = number.rsplit('.', 1) |
398 # 2.3 compat: this is rsplit | |
399 parts = number.split('.') | |
400 integer, fraction = '.'.join(parts[:-1]), parts[-1] | |
401 else: | 398 else: |
402 integer = number | 399 integer = number |
403 fraction = '' | 400 fraction = '' |
404 min_frac = max_frac = 0 | 401 min_frac = max_frac = 0 |
405 | 402 |