Help

Formula field set to currency with 2 decimal places but getting up to 14 in token

Topic Labels: Automations Formulas
Solved
Jump to Solution
322 3
cancel
Showing results for 
Search instead for 
Did you mean: 
sam-lsf-lst
5 - Automation Enthusiast
5 - Automation Enthusiast

I'm experiencing something weird - I have a formula field ("Cheque 2 amount") set up to subtract different currency fields. All fields, including Cheque 2 amount are set to currency format with 2 decimal places. 

samlsflst_0-1718197080923.png

 

Everything looks normal in Airtable:

samlsflst_1-1718197352974.png

However, I have a "send email" automation set up that uses the Cheque 2 Amount as a token, and some of those emails are displaying this token with 14 or so extra decimal places (here is the email generated from that same record above): 

samlsflst_2-1718197396888.png

Seems to be happening to maybe a quarter of the 160 or so records I was working with this morning. 

I can't see anything different about the ones that are experiencing this glitch. My best guess is it has something to do with the Cheque 1 Amount field, which is a formula that calculates a percentage (SUM(.75*{Approved budget})) - however it is also set to currency format with 2 decimal places, along with all the other fields. 

Anyone have any ideas???

 

 

1 Solution

Accepted Solutions
BillH
9 - Sun
9 - Sun

Setting the format to 2 decimal places only changes what you see, the underlying amount remains the same.  

Try ROUND((SUM(.75*{Approved budget}))*100)/100 

If that is the only number causing the issue it should work.

See Solution in Thread

3 Replies 3

Try creating a formula field with `ROUND()` to round your value to 2 decimal places and using that formula field's output in your email instead

Should be related to this: https://community.airtable.com/t5/formulas/floating-point-error-addition-subtraction/td-p/119000

BillH
9 - Sun
9 - Sun

Setting the format to 2 decimal places only changes what you see, the underlying amount remains the same.  

Try ROUND((SUM(.75*{Approved budget}))*100)/100 

If that is the only number causing the issue it should work.

sam-lsf-lst
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks! I actually ended up putting the ROUND formula within the Cheque 2 amount field and that seems to work! 

IF(
    {Over/Under} > 0, 
    ROUND(SUM({Approved budget} - {Cheque 1 Amount} - {Over/Under}), 2), 
    ROUND(SUM({Approved budget} - {Cheque 1 Amount}), 2)
)