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

How do you remove a zero value in a Calculated Field?

New Here ,
Feb 05, 2016 Feb 05, 2016

I have a calculated field that multiplies the unit price with quantity. But the total field has a zero in it if either field is zero.

I need to remove that zero from the calculated field.

Currently have the calculated field as:

TotalPrice = Qty1 * UnitPrice

Need to have TotalPrice blank if fields have a zero in it.

Thanks.

TOPICS
Acrobat SDK and JavaScript
761
Translate
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 Employee ,
Feb 05, 2016 Feb 05, 2016

Hi slabby,

I am sorry that won't be possible. Calculated field shows 0 by default if there is no data entered in either of the fields.

Regards,

Meenakshi

Translate
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 ,
Feb 05, 2016 Feb 05, 2016

Wrong. It's easily done with a custom validation script, like this one:

if (event.value==0) event.value = "";

Translate
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 ,
Feb 05, 2016 Feb 05, 2016

so you are saying the code should be:

if (event.value==0) event.value = "";

this should be pasted into the calculated field section?

Could you be more specific with your answer?

The calculated field is TotalPrice.

Translate
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 ,
Feb 05, 2016 Feb 05, 2016
LATEST

As I wrote, it needs to be entered into the custom validation script.

It can also be used in the custom calculation script, but then you'll need to perform the entire calculation using JS.

Translate
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