How to format a integer fields to Currency?
The requirement is like, Users will enter their salary, no alpa, just numbers. After finishing type, the numbers converted to currency formatting.
E.g. 1234 --> $1,234.00
Can someone help on the script on the data transformer and also need to limit user enter any other charactors but only numbers.
Note: the Salary Field is a String field.
This is where I got so far, but it doesn't work..
var salaryScript = "";
salaryScript = "var salary = getField("Salary");";
salaryScript += "var salaryEntered = salary.value;";
salaryScript += "var currency = '$' + parseFloat(salaryEntered).toFixed(2).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');";
salaryScript += "salary.value = currency;";
var salaryField = getField("Salary");
salaryField.setAction("OnBlur", salaryScript );
