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

HTTP with ruby

In my job we recently decided to use an email management tool called getResponse which I started to build the adapter to user with its API. One of the first things I did was to test the creation of an email with curl: curl -X POST https://api3.getresponse360.pl/v3/contacts -d ‘{“email”: “adnilson@frontline.cv”, “campaign”: { “campaignId”: “G” } […]

Read More HTTP with ruby