Forum Discussion

barrytallis's avatar
barrytallis
Data Storage
10-29-2021
Solved

Is there any way to convert a string to a number?

We have a field that has text and "text numbers" .  Any way in a widget to be able to convert the text to a number?
  • javierecfpn's avatar
    11-03-2021

    You can have a custom table that converts the field to number, the values that are not possible to be converted are just gonna be empty (null)

    select
    todouble(quantity)
    from (
    select 'AA1' as quantity
    union all select '29228'
    union all select '0001'
    union all select 'xxa$%#1'
    ) dt