Skip to main content
Solved

Coercing data type to number

  • March 30, 2020
  • 2 replies
  • 32 views

WilliamPorter
Forum|alt.badge.img+19

I’m pulling a numeral out of a string, for example, extracting “27” from “WP27”. Is there a way to coerce that extracted numeral to a number value? I’ve discovered that Airtable throws an #ERROR if I use that extracted value in a math formula like MyExtractedNumber * ItemPrice. I presume that’s because it thinks the value in MyExtractedNumber is “27” and not simply 27, ie a text value and not a number.

There’s a way in Airtable to create a date value from parts but I’ve searched for something like a NUMBER() function and can’t find it. Am I missing something?

William

Best answer by JonathanBowen

Hi @WilliamPorterTech - you could use the VALUE function:

JB

2 replies

JonathanBowen
Forum|alt.badge.img+18
  • Inspiring
  • Answer
  • March 30, 2020

Hi @WilliamPorterTech - you could use the VALUE function:

JB


WilliamPorter
Forum|alt.badge.img+19

Hi @WilliamPorterTech - you could use the VALUE function:

JB


FANTASTIC! Thank you so much Jonathan.

I did try to find this on my own but couldn’t find it searching on “coerce” or “data type” or just “type” and it didn’t occur to me that it would have the totally opaque name “VALUE”. And I did scroll through the whole list of Number functions but I missed it. Anyway, very glad to know it’s there – and now I can undo the workaround I’d come up with and do what I’m trying to do properly.

Muchas gracias,

William