fix error in formatNumber
This commit is contained in:
		
							parent
							
								
									6579752dce
								
							
						
					
					
						commit
						6aea218261
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -52,10 +52,10 @@ def formatDate(dt=None, type='date', variant='medium', lang='de'): | ||||||
|     return fmt.format(dt or datetime.now()) |     return fmt.format(dt or datetime.now()) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def formatNumber(num, type='decimal', lang='de'): | def formatNumber(num, type='decimal', lang='de', pattern=u'#,##0.00;-#,##0.00'): | ||||||
|     loc = locales.getLocale(lang) |     loc = locales.getLocale(lang) | ||||||
|     fmt = de.numbers.getFormatter(type) |     fmt = loc.numbers.getFormatter(type) | ||||||
|     return fmt.format(num) |     return fmt.format(num, pattern=pattern) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def toStr(value, encoding='UTF-8'): | def toStr(value, encoding='UTF-8'): | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue