OK, to add a new document-level JavaScript, select: Tools > JavaScript > Document JavaScripts
and in the dialog that comes up, enter a Script Name (e.g., "formats"), and replace what it give you by default with the following:
// Document-level JavaScript
function RM_Format() {
AFNumber_Format(2, 0, 0, 0, "RM ", true);
}
function RM_Keystroke() {
AFNumber_Keystroke(2, 0, 0, 0, "RM ", true);
}
Then edit the text field and select the Format tab, and set the custom Format script to:
// Custom Format script
RM_Format();
and the custom Keystroke script to:
// Custom Keystroke script
RM_Keystroke();
and that should do it.
If you don't see the Tools > JavaScript item, click the tiny "Show or hide panels" icon on the far right of the darker gray bar that appears Tools button after it's clicked and select it from the list of panels.