0

Is there an easier way to convert a payment choice into a number?

OK - I have a choice field that lets you select 29.97 or 39.97 or 49.97 I then have a formular field that contains code:

if 'Chose Payment Amount' = 1 then
29.97
else
if 'Chose Payment Amount' = 2 then
39.97
else
if 'Chose Payment Amount' = 3 then
49.97
end
end
end

So I could then use the result in that field in other numeric calculations - is there a more direct way of taking the value from a choice field?

Thanks.

6 replies

null
    • Sean
    • 4 yrs ago
    • Reported - view
    • Winghigh Limited
    • Robert_AgarHutton
    • 4 yrs ago
    • Reported - view

    Hi Sean,

    Thanks, but I can't get it to work - have tried formula variations in Choose Payment Amount, Value is, and VALUE 2 fields - the best I get is "undfined" in Value is - Where should the formula go?

    • Choices_Software_Dean
    • 4 yrs ago
    • Reported - view

    let n := number(text('Chose Payment Amount'));
    n

    • Winghigh Limited
    • Robert_AgarHutton
    • 4 yrs ago
    • Reported - view

    Oh how strange - now it's working with number(text('Chose Payment Amount')) in the formula field???

    • Sean
    • 4 yrs ago
    • Reported - view

    Yes, it goes in the Formula field and you use it by itself without the if-then-else statements. It should be the only line of code in the formula field and it shouldn't be necessary to assign the value to a variable.

    • Winghigh Limited
    • Robert_AgarHutton
    • 4 yrs ago
    • Reported - view

    Thanks Sean.

Content aside

  • 4 yrs agoLast active
  • 6Replies
  • 899Views