2 Replies Latest reply on Jul 22, 2010 1:52 PM by jbash83

    Script to Format as Currency & Ignore Commas


      I am working on fields that eventually will be summed. I have some custom keystroke scripts, so I have had to use javascript to do the formating (I want currency). Here's what I have so far:


      this.getField(event.target.name).setAction("Format", 'AFNumber_Format(2, 0, 0, 0, "$", true)');


      This is working for me, an when you type "1" into the field, it makes it into "$1.00", which is what I want. However, if I type in "5,000" it reads that as "5" when everything is summed up. I can only figure it is reading the comma as a decimal point. I thought the above code indicates that it should use commas as the seperator value (hence the 0 in that attribute's place in the formula). I just can't crack this problem. Any ideas or code? Thank you in advance.