I’m updating fattura24 App for Zapier. In my scripting.js file I added a function to format numbers like this:
function numberFormat(number) {
var strResult = +number
.toString()
.replace(/,/g, '.')
.replace(/\.(?=.*\.)/g, '')
.replace(/[^0-9.]/g, '');
return Number(strResult);
}
I sent two test values: first “10,00”, second “1,000.00”. In the first scenario I should get “10” as a result, but I actually got “1000”; in the second I should get “1000” but I got a NaN. Any suggestions? Thanks