Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Whole number without rounding...
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Whole number without rounding...

 Post Reply Post Reply
Author
RaeEveMay View Drop Down
New Member
New Member
Avatar

Joined: 31 Jan 2012
Location: Big Bear Lake
Points: 7
Post Options Post Options   Quote RaeEveMay Quote  Post ReplyReply Direct Link To This Post Topic: Whole number without rounding...
    Posted: 28 Jan 2015 at 8:20pm
I need to get the value of a field "LOAN_AMT" that is a numeric field with two decimals and convert that into a new field "LOAN_AMT_NO_CENTS" that does not round. This is the problem I am having:

LOAN_AMT=15.75
LOAN_AMT_NO_CENTS pulls in 16 instead of 15. 

I basically just need to truncate the cents off of the amount.

I know this does not make sense most forms would require you to show 16 in the example above but that's the Federal Government for you! These new forms are a nightmare!

Any advice is greatly appreciated.

Thank you,

Rae
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 629
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 2015 at 11:31pm
Use this code as the custom calculation script of LOAN_AMT_NO_CENTS:
event.value = Math.floor(+this.getField("LOAN_AMT").value);
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
RaeEveMay View Drop Down
New Member
New Member
Avatar

Joined: 31 Jan 2012
Location: Big Bear Lake
Points: 7
Post Options Post Options   Quote RaeEveMay Quote  Post ReplyReply Direct Link To This Post Posted: 29 Jan 2015 at 7:09pm
Thank you! That worked like a charm! 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.047 seconds.