Help

Setting precision for 12 places after the decimal for Crypto API

Topic Labels: API
Solved
Jump to Solution
1169 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Paul_Naraine
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi all,
I’m getting crypto prices from the Coinmarketcap API and the prices have 12 decimal places E.g. $0.000000007269

However, when I fetch the prices into Airtable, the field [Prices] has precision set to 1.0000000 - 7 places and missing the remaining 5 places.

Is there a way to resolve this?

Thanks in advance,
Paul

2 Solutions

Accepted Solutions
Justin_Barrett
18 - Pluto
18 - Pluto

One option is to save it into a text field. If you need to use it in any calculations, wrap the field reference in the VALUE() function to turn it back into a number. To display the result, concatenate it with an empty string to re-stringify it. It’s a few extra steps, but the precision should be maintained (knock on wood; I’ve never done super precise math with Airtable formulas, so I recommend running tests to ensure that this process will work for your use case).

See Solution in Thread

kuovonne
18 - Pluto
18 - Pluto

A number/currency field is capable of storing a number with 12 decimal places if you set the value via scripting API. However, the user interface will not show these additional decimal places. You can see that the extra decimal places are stored in the editable field by using a formula field to convert the value to a string (e.g. {price} & "").

See Solution in Thread

2 Replies 2
Justin_Barrett
18 - Pluto
18 - Pluto

One option is to save it into a text field. If you need to use it in any calculations, wrap the field reference in the VALUE() function to turn it back into a number. To display the result, concatenate it with an empty string to re-stringify it. It’s a few extra steps, but the precision should be maintained (knock on wood; I’ve never done super precise math with Airtable formulas, so I recommend running tests to ensure that this process will work for your use case).

kuovonne
18 - Pluto
18 - Pluto

A number/currency field is capable of storing a number with 12 decimal places if you set the value via scripting API. However, the user interface will not show these additional decimal places. You can see that the extra decimal places are stored in the editable field by using a formula field to convert the value to a string (e.g. {price} & "").