• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

545

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

Community Expert , 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;

Votes

Translate

Translate
Community Expert ,
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?

Votes

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...

Votes

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
Community Expert ,
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;

Votes

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.

Votes

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.

Votes

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
Community Expert ,
Jul 31, 2022 Jul 31, 2022

Copy link to clipboard

Copied

Change last line to this:

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

Votes

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.

Votes

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