Extract digits from number and sum them

Hi,
I am trying to separate a 4-digit number into its separate numbers and sum them (for numerology purposes). This code works for the first digit but fails after that. What do you suggest? thanks.
image

You can use the Expression element which you get in the Toolbox plug-in for this. If it’s possible to do in Bubble, it will be long winded but probably doable if you only ever have 4 digits and not less or more.

Thanks. I’ll take a look.

Here’s one way you can do it

Paul-testing-4 | Bubble Editor

That is fantastic! And it’s the way that I prefer to program. Thank you!

1 Like

So sorry! My demo pages change frequently, especially the test ones, I thought you’d be done with that code now but no problems, I will put it back for you. Will let you know as soon as it’s done :+1:

It’s back now. You may want to make a copy of it.

Thanks! I had deleted my request because I had found your original coding, but this extra coding was also helpful.

1 Like

Hi,
Would be it possible to post a few key screenshots just to get a view of what the solution was?

Thanks!