Add byjoveCurrency filter
				
					
				
			This commit is contained in:
		
							parent
							
								
									0ceabeb53f
								
							
						
					
					
						commit
						985860732d
					
				
					 1 changed files with 13 additions and 0 deletions
				
			
		|  | @ -37,4 +37,17 @@ export function ByjovePlugin(Vue) { | |||
|             }, | ||||
|         } | ||||
|     }) | ||||
| 
 | ||||
|     Vue.filter('byjoveCurrency', function (value) { | ||||
|         if (typeof value !== 'number') { | ||||
|             return value | ||||
|         } | ||||
|         var formatter = new Intl.NumberFormat('en-US', { | ||||
|             style: 'currency', | ||||
|             currency: 'USD', | ||||
|             // TODO: make this configurable?
 | ||||
|             minimumFractionDigits: 2, | ||||
|         }) | ||||
|         return formatter.format(value) | ||||
|     }) | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar