Javascript format to currency
function formatToCurrency(amount){
return (amount).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
}
formatToCurrency(12.34546); //"12.35"
formatToCurrency(42345255.356); //"42,345,255.36"
Also in JavaScript:
- react js filter array of on search
- html working with JSON data
- take a screen shot of a image within a div using js
- hello world in jsp
- drupal 8 check if current page is node
- jquery OR operator
- create react app and tailwind
- notify js
- checking ascii in js
- number_format in jquery
- print all variables defined javascript
- how to hide header in react navigation
- javascript compare number to string
- concurrently node react
- reactjs start project
- h«javascript variable declaration
- switch i javascript
- factory function javascript
- fibonacci series in javascript in range using document.getelementbyid
- datatables add row
- pause console debugger in react
- discord bot remove message reaction
- required false jquery
- jquery check checkbox