Format currency field with JavaScript

Last month I got a solution to format the currency fields from Wundertax’s declarations This is the function: var formatCurrency = function(element) { $this = $(element); var number = $this.val() number = number.replace(/[^0-9,.]/g, ”) if (number === ”) { number = ‘0,00’ } else { splitted_number = number.split(/[\,.]/g) if (splitted_number.length > 2) { decimal_numbers = […]

Read More Format currency field with JavaScript

var and let the difference in JavaScript

Javascrit has something called Hoisting. This is when all variables and functions are loaded before the program runs. function loadProfiles(userNames){ // some code… var loadingMessage = “Hold a sec… Profiles loading!”; // some code… } var loadingMessage = “Loading your profile!”; What will happen here is that the first declaration of loadingMessage will be loaded […]

Read More var and let the difference in JavaScript