2

Decimal Places
I'm trying to send number data through Zapier, but Zapier does not seem to pick up the 2 decimal places when they are '.00'. In addition, it only picks up one number after the decimal place when the second number is 0.

Here's what I'm doing: form user enters two numbers. My form then:

  1. Adds these numbers together (SUBTOTAL)
  2. Multiplies SUBTOTAL by 0.23 (VAT)
  3. Adds SUBTOTAL to VAT (TOTAL)

On Cognito Forms, all of these numbers display to two decimal places (even when they are '.00'). However, when I send the information through Zapier, Cognito Forms appears to have dropped the 2 decimal places if they are '.00', or dropped one decimal place if it is, for example, '.20'.

I have read the support section on math functions and it looks like Math.Round(Number, Number) might be what I'm looking for, however based on the provided instructions I cannot get that to work.

Does anyone have any advice?

1

In this case, the issue is more with how Zapier handles the data sent from Cognito Forms than with Cognito Forms itself.

All data sent via integrations, such as Zapier or JSON webhooks, is sent as real data, so text is sent as text, dates as dates (in ISO 8601 format), yes/no values as true/false Booleans, and numbers as numbers. Our integration lets Zapier know what the type of each field is so it can handle the information accordingly.

If you want to force the information sent to Zapier to have a specific number of decimal places, then consider adding a Calculation - Text field and using a calculation to pull the value of your number and turn it into a text value with the number of decimal places that you want. You also may be able to update your Zap configuration to handle this, but that would likely depend on the app your are ultimately connecting to through Zapier and what types if information it supports.

Here is the calculation to convert a numeric field into a text value with two decimal places:

=MyNumberField.ToString("N2")

  • +1, thanks. I wish I could thank you properly for the time you took to post that answer - it explains it perfectly and now I am able to do what I needed. Thanks so much. – Gerard Apr 21 '16 at 14:07
  • Just tell other people about Cognito Forms, that is all we ask! – Jamie Thomas Apr 21 '16 at 17:28
  • @Gerard: On Stack Exchange, the way you indicate to the world that an answer was the best at solving your problem, and to reward the person who answered it, is to "accept" the answer. More details in the Help Center. – ale Oct 10 '17 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.