Print Page | Close Window

How to make a format e.g.: 1 456,56 how to make s

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: PDF Forms and FDF
Forum Description: This conference is for users of PDF Forms, JavaScript and FDF Toolkits.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=2121
Printed Date: 20 May 2019 at 5:57pm
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: How to make a format e.g.: 1 456,56 how to make s
Posted By: Robert1977
Subject: How to make a format e.g.: 1 456,56 how to make s
Date Posted: 26 Jan 2017 at 2:40pm
Hi,

 

How to set this kind of format in number field in PDF form: 1 235 456,54 or 4 545,45 or 1 184 848 545,54 ??

This kind of format isn't available 

 

AND

 

I have two fields A and B.

Field C = A - B  if  A - B > 0, if not =0

Field D = B - A  if  B - A > 0, if not =0

How to make calulations in field C i D ???

 

Please help in these two simple questions.

ThankS !

uploads/2221/example.pdf - uploads/2221/example.pdf



Replies:
Posted By: Merlin
Date Posted: 28 Jan 2017 at 1:47pm
Hi.


Originally posted by Robert1977 Robert1977 wrote:

How to set this kind of format in number field in PDF form: 1 235 456,54 or 4 545,45 or 1 184 848 545,54 ?

Since the French number format is not buit-in in Acrobat you must use this JavaScript as a custom validation script:

event.value = util.printf("%,2.2f",event.value).toString().replace(/\./gim," ");



Originally posted by Robert1977 Robert1977 wrote:

I have two fields A and B.

Field C = A - B  if  A - B > 0, if not =0

Field D = B - A  if  B - A > 0, if not =0

How to make calulations in field C i D ?



var valeurA = this.getField("Text_A").value;
var valeurB = this.getField("Text_B").value;
var total = (valeurA - valeurB) * 1;
// here is the difference
if (total < 0) {total = 0;}
event.target.value = total;


and

var valeurA = this.getField("Text_A").value;
var valeurB = this.getField("Text_B").value;
var total = (valeurB - valeurA) * 1;
// here is the difference
if (total < 0) {total = 0;}
event.target.value = total;

See attachment.

uploads/615/example-ok_2017-01-28_13-47-11.pdf - uploads/615/example-ok_2017-01-28_13-47-11.pdf


.



-------------
ENG : https://www.abracadabrapdf.net/utilities-in-english/welcome/ - abracadabraPDF.net
FRA : https://www.abracadabrapdf.net - abracadabraPDF.net


Posted By: Robert1977
Date Posted: 02 Feb 2017 at 12:29pm
MERLIN, THANK YOU VERY MUCH !!!!! Clap


Posted By: Merlin
Date Posted: 04 Feb 2017 at 12:58pm
Originally posted by Robert1977 Robert1977 wrote:

1 235 456,54 or 4 545,45 or 1 184 848 545,54


Is this number format also used in Poland?


-------------
ENG : https://www.abracadabrapdf.net/utilities-in-english/welcome/ - abracadabraPDF.net
FRA : https://www.abracadabrapdf.net - abracadabraPDF.net



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net