Expand a Number I

Published by Deep Xavier in

Create a function that expands a number into a string as shown below:

54 ➞ "50 + 4"
70701 ➞ "70000 + 700 + 1"
466 ➞ "400 + 60 + 6"

Examples

expandedForm(544) ➞ "500 + 40 + 4"

expandedForm(4666) ➞ "4000 + 600 + 60 + 6"

expandedForm(70304) ➞ "70000 + 300 + 4"

expandedForm(1037903) ➞ "1000000 + 30000 + 7000 + 900 + 3"

expandedForm(802539) ➞ "800000 + 2000 + 500 + 30 + 9"

Notes

I deliberately exclude 10 and below values as inputs to the test because they are not part of the scope of this challenge. Maybe if given the chance, it will be included in the next level challenge.

Watch a quick demo on how Edabit works.