This content has been marked as final.
Show 6 replies

1. Re: Calculations  Rounding problems
George_Johnson Aug 5, 2008 2:02 PM (in response to (Terry_Secor))How are you rounding those other values to the nearest dollar in the first place, and how are you setting the field values?
George 
2. Re: Calculations  Rounding problems
(Terry_Secor) Aug 5, 2008 2:33 PM (in response to (Terry_Secor))As for the rounding, I'm using the text field poperties. I select the format tab and select the number category and select no decimal place.
I start off typing in the beginning balances. Then they go through various basic calculations (addition, subtraction, & multiplication). I set these up using the calulate tab in the text field properties. I hope that answeres your question. Thanks again 
3. Re: Calculations  Rounding problems
gkaiseril Aug 6, 2008 6:28 AM (in response to (Terry_Secor))The text field properties only change the value for display not computations. If you want the field value to be rounded for later computations you will need to write a rounding calculation. You can either use the "Math.round()" of JavaScript or the "util.printf() of Acrobat JavaScript. Since you will most likely be using this many times it would be best written as a document function. 
4. Re: Calculations  Rounding problems
(Terry_Secor) Aug 6, 2008 7:48 AM (in response to (Terry_Secor))Can you give me an example of how to write the script for that. I've tried the Math.round() but I've been unsuccessful. Basically I'm trying to write Math.round(Text#)+Math.round(Text#). Is there supposed to be more script before or after Math.round() to make it work properly? I really do appreciate your help. 
5. Re: Calculations  Rounding problems
gkaiseril Aug 6, 2008 8:10 AM (in response to (Terry_Secor))If you are using LiveCycle Designer FormCalc:
// sum the rounded values of the field's Text1 and Text2 rounded to whole dollars
Round(Text1, 0) + Round(Text2, 0)
If you are using Acrobat's form foields, the custom script for the same example would be:
event.value = Math.round(this.getField("Text1").value) + Math.round(this.getField("Text2").value); 
6. Re: Calculations  Rounding problems
(Terry_Secor) Aug 6, 2008 9:31 AM (in response to (Terry_Secor))Awesome!!! Problem resolved. Thanks a ton for the help. I really appreciate it.