Javascript - Custom Format and Keystroke Script
Hello,
I have a field with a custom keystroke:
if( event.willCommit )
{
if(event.value == "")
//if nothing is chosen in box1 then box2 will be cleared
this.getField("Text412").clearItems();
else
SetFieldValues(event.value);
}
I would also like this same field to be formatted with two places after the decimal. I am assuming I would need to add code to the Custome format Format script to accomplish that but I don't know how or what scritp to write. Since I don't know how to write javascript I just search and try to adapt what I find. I found this talking about a custome format script:Archived Forum Answer (2 places after decimal)
So I thought I just needed to add this line
Number(event.value).toFixed(2);
to the custom format script but it doesn't work. Is it because I need to add more to the script? Or is my approach completely wrong anyway? Any guidance would be appreciated!
Thanks!
Ariel
