Please help me in solving this...

Sep 10, 2020

Copy link to clipboard

Copied

I'm working on form Adobe Livecycle Designer which has a Tax field, I want it to be with only 2 decimals without rounding it off.

I'm using FormCalc and the fields are

SubTotal and VAT

formula using in FormCalc (Calculate) "$=SubTotal*5/100"

Ex: for the amount of 1037.50*5/100 = 51.875

and this give the round off result as 51.88

I want this to be 51.87 (I want the result to be without round off)

TOPICS
Create PDFs, Edit and convert PDFs, How to, PDF forms

Views

81

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Please help me in solving this...

Sep 10, 2020

Copy link to clipboard

Copied

I'm working on form Adobe Livecycle Designer which has a Tax field, I want it to be with only 2 decimals without rounding it off.

I'm using FormCalc and the fields are

SubTotal and VAT

formula using in FormCalc (Calculate) "$=SubTotal*5/100"

Ex: for the amount of 1037.50*5/100 = 51.875

and this give the round off result as 51.88

I want this to be 51.87 (I want the result to be without round off)

TOPICS
Create PDFs, Edit and convert PDFs, How to, PDF forms

Views

82

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 10, 2020 0
Sep 10, 2020

Copy link to clipboard

Copied

Hello 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 10, 2020 0
Sep 10, 2020

Copy link to clipboard

Copied

You could share your field names that are in calculation, now I can only give you example:

var dec = this.getField("Text4").value;
event.value = Math.floor(dec*100)/100;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 10, 2020 0
Sep 10, 2020

Copy link to clipboard

Copied

Thanks for the reply Nesa.

I'm using FormCalc and the fields are

SubTotal and VAT

formula using in FormCalc (Calculate) "$=SubTotal*5/100"

Ex: for the amount of 1037.50*5/100 = 51.875

and this give the round off result as 51.88

I want this to be 51.87 (I want the result to be without round off)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 10, 2020 0
Sep 10, 2020

Copy link to clipboard

Copied

Sorry I'm not familiar with Adobe Livecycle Designer, I'm guessing there has to be some sort of script editor
where you can write javascript code?
I'm gonna try explain best I can.
your code should look something like this:
var Subt = this.getField("SubTotal").value;
var Vat = this.getField("VAT").value;
var dec = Subt*Vat/100;
event.value = Math.floor(dec*100)/100;

Code should go to field where you showing result as custom calculation script.
Hope this helps 🙂

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 10, 2020 0
Sep 10, 2020

Copy link to clipboard

Copied

Unfortunately LiveCycle Designer has a different JavaScript. For example, there is no "getField" method. So nothing is portable from Acrobat...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 10, 2020 0
Sep 10, 2020

Copy link to clipboard

Copied

I would appriciate if you help me to achive this.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 10, 2020 0
Sep 10, 2020

Copy link to clipboard

Copied

You will need to post in a forum devoted to LiveCycle Designer scripting. Acrobat is entirely different, and that's what we know here. You may struggle to find help, since Designer forms are obsolete.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 10, 2020 0
syd1980 LATEST
Sep 10, 2020

Copy link to clipboard

Copied

Noted,

Thanks though, for you reply.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 10, 2020 0