Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

# Hex Decimal Conversion

Topic Labels: Formulas
552 4
cancel
Showing results for
Did you mean:
5 - Automation Enthusiast

Hi there! I’m using an API to retrieve the balance of crypto wallets. The issue is that the balances are returned in Hex decimal format and there isn’t a native function to convert from hex decimal to regular decimal in Airtable. The manual conversion is rather complex and not ideal at all. Wondering if there are any workarounds?

4 Replies 4
18 - Pluto

Do you know the upper limit for the hexadecimal number? Is there a minimum or maximum number of digits?

You say the manual conversion process is complex. What manual process are using?

Your best bet is probably using a script to do the conversion. If the numbers are small enough, you could use a formula field that parses out the digits and does the math, but a script would be more robust.

5 - Automation Enthusiast

Thanks for the response!
There are always 16 digits. For example 2212844d4c6e8000

The manual process is
(2212844D4C6E8000)₁₆ = (2 × 16¹⁵) + (2 × 16¹⁴) + (1 × 16¹³) + (2 × 16¹²) + (8 × 16¹¹) + (4 × 16¹⁰) + (4 × 16⁹) + (13 × 16⁸) + (4 × 16⁷) + (12 × 16⁶) + (6 × 16⁵) + (14 × 16⁴) + (8 × 16³) + (0 × 16²) + (0 × 16¹) + (0 × 16⁰) = (2455170214400000000)₁₀

Unfortunately I don’t have any experience writing scripts but will search online to find one!

18 - Pluto

Thank you for describing the manual process. That is the same process that could be used by a formula or a script. If there are always 16 digits, it might be possible to write a formula, but it might be pushing the limits of a formula field. If you have trouble finding a script online but have budget to hire someone to write the script, feel free to book an appointment with me.

5 - Automation Enthusiast

Thank you, managed to figure out a solution but appreciate the offer!