How to set own (number, specific) format? SOLVED
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
How to set own (number, specific) format?
¨I am a newbie in PDF-XChange editor.
In my form I need to set specific number format:
number with two decimal places after comma & space as thousands separator. Number, because calculation follows…
Examples:
12 345, 67
123,45
1 234 567,89
0,00
Can I add this format anywise?
I found no "space separator" there,
Second format, Czech ZIP code, format "000 00" is needed (example: 445 01). Build-in format is set to "00000", can I add this?
Thanks very much for helping me.
In my form I need to set specific number format:
number with two decimal places after comma & space as thousands separator. Number, because calculation follows…
Examples:
12 345, 67
123,45
1 234 567,89
0,00
Can I add this format anywise?
I found no "space separator" there,
Second format, Czech ZIP code, format "000 00" is needed (example: 445 01). Build-in format is set to "00000", can I add this?
Thanks very much for helping me.
- Tracker Supp-Stefan
- Site Admin
- Posts: 17810
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: How to set own (number, specific) format?
Hello siSINka,
Under the Format Value entries for the field, please select "Custom Action" then for "Format Action" there would be "Run a JavaScript" entry. Click the three dots next to it:
And then in the new window that will open - copy and paste either this:
If you want your number to be formatted as 123 456 789.10 (decimal separator being dot)
or this:
If you want it formatted as 123 456 789,10 (decimal separator being coma)
Regards,
Stefan
Under the Format Value entries for the field, please select "Custom Action" then for "Format Action" there would be "Run a JavaScript" entry. Click the three dots next to it:
And then in the new window that will open - copy and paste either this:
Code: Select all
if (event.value) {
event.value = util.printf("%,0.2f", event.value ).split(',').join(' ');
}
or this:
Code: Select all
if (event.value) {
event.value = util.printf("%,2.2f", event.value ).split('.').join(' ');
}
Regards,
Stefan
Re: How to set own (number, specific) format?
Thanks very much!
I see, that red number is "count of numbers" after decimal dot/comma.
If "0", number is in format 0 000 000, por example 1 234
Format: 000 00
I see, that red number is "count of numbers" after decimal dot/comma.
If "0", number is in format 0 000 000, por example 1 234
And our ZIP code?if (event.value) {
event.value = util.printf("%,0.0f", event.value ).split(',').join(' ');
}
Format: 000 00
- Tracker Supp-Stefan
- Site Admin
- Posts: 17810
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: How to set own (number, specific) format?
Hello siSINka,
Yes the .2 is the number of characters to be displayed after the decimal separator.
Attached you will find two pages extracted from this file:
https://www.adobe.com/content/dam/acom/ ... erence.pdf
Where the printf syntax is explained.
As for ZIP codes - we have the "Category: Special" type for form fields - so select that, and from there the desired ZIP code template.
Regards,
Stefan
Yes the .2 is the number of characters to be displayed after the decimal separator.
Attached you will find two pages extracted from this file:
https://www.adobe.com/content/dam/acom/ ... erence.pdf
Where the printf syntax is explained.
As for ZIP codes - we have the "Category: Special" type for form fields - so select that, and from there the desired ZIP code template.
Regards,
Stefan
- Attachments
-
- Pages from js_api_reference.pdf
- (179.99 KiB) Downloaded 117 times
Re: How to set own (number, specific) format?
I found build-in ZIP format in editor previously, but it is as "00000", I need "000 00" with space between 3. and 4. numbers. For example "735 01".
- Tracker Supp-Stefan
- Site Admin
- Posts: 17810
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: How to set own (number, specific) format?
Hello siSINka,
I will need to check with a colleague from the dev team on how to achieve that.
Is the ZIP code digits only or can it be any alpha numeric symbols?
Regards,
Stefan
I will need to check with a colleague from the dev team on how to achieve that.
Is the ZIP code digits only or can it be any alpha numeric symbols?
Regards,
Stefan
Re: How to set own (number, specific) format?
Only digist, 0-9, format 000 00.
- Ivan - Tracker Software
- Site Admin
- Posts: 3549
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Re: How to set own (number, specific) format? SOLVED
One of the ways to do that would be to use the following JavaScript:
HTH
Code: Select all
// convert current field value to a number
var n = 1 * event.value;
// format it
event.value = util.printx("999 99", util.printf("%05d", n));
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Re: How to set own (number, specific) format?
Yes! My problem is solved.
Thank you very much!
Thank you very much!
- Tracker Supp-Stefan
- Site Admin
- Posts: 17810
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact: