Answered
I'm using the following in a validation event in LiveCycle Designer 8.
var MBn = (iSizeN / 1383.27)/ 1024;
The result is a digit with around 10 decimal places.
1) What do I need to do so that the result is only 2 decimal places?
2) How do I then convert the 2-decimal place number to a text string so that I can use it in a message? Note that I still need access to the MBn variable so the string variable would be MBs.
Thank you for the help.
Second, in JavaScript you can use the "util.printf()" function to format a number into text for display. This is an Acrobat JavaScript function, but it will work just fine in a LiveCycle JavaScript.
There is also a "Format()" function in FormCalc that uses a Picture Clause to format data.
So there are a number of options.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script