Only Decimal Value

New Here ,
Jul 24, 2022 Jul 24, 2022

Copy link to clipboard

Copied

Hi,

    Please help me with this one. I only want to display the decimal value.

 

Example: 1.23 it should show 23 only

 

Thanks in advance

 

TOPICS
JavaScript , PDF forms

Views

55

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
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jul 25, 2022 Jul 25, 2022

As 'Custom format script' use this:

var str = event.value;
var sp = str.split(".")[1];
if(event.value)
event.value = sp;

Likes

Translate

Translate
Adobe Community Professional ,
Jul 24, 2022 Jul 24, 2022

Copy link to clipboard

Copied

You want to show it in a same field where value is, or in another field? Do you want decimal to be just format or actual value?

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
community guidelines
New Here ,
Jul 25, 2022 Jul 25, 2022

Copy link to clipboard

Copied

I would like it to be shown on the same field where the value is and be just format.

Thnx for the quick 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
community guidelines
Adobe Community Professional ,
Jul 25, 2022 Jul 25, 2022

Copy link to clipboard

Copied

As 'Custom format script' use this:

var str = event.value;
var sp = str.split(".")[1];
if(event.value)
event.value = sp;

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
community guidelines
New Here ,
Jul 25, 2022 Jul 25, 2022

Copy link to clipboard

Copied

Thank you very much!!! that's what I needed.

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
community guidelines
New Here ,
Jul 31, 2022 Jul 31, 2022

Copy link to clipboard

Copied

I would like to ask a follow up question. What do I add to make it show only 2 digits.

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
community guidelines
Adobe Community Professional ,
Jul 31, 2022 Jul 31, 2022

Copy link to clipboard

Copied

Change last line to this:

event.value = sp.slice(0,2);

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
community guidelines
New Here ,
Jul 31, 2022 Jul 31, 2022

Copy link to clipboard

Copied

LATEST

Thank you very nuch.

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
community guidelines