9 Replies Latest reply on Aug 21, 2009 1:53 PM by RickWhitelaw

# Adding digits 1234 = 1+2+3+4 = 10= 1+ 0= 1

### Title

Adding digits 1234 = 1+2+3+4 = 10= 1+ 0= 1

### Post

Anyone know how to create a calculation using FMP 10 Advanced?  Thanks for all of your suggestions : )  I am trying to do an automated color and numbers calendar and got stuck thinking there must be a quick way of making FMP Advanced do a lot of the work rather than the end user.

• ###### 1. Re: Adding digits 1234 = 1+2+3+4 = 10= 1+ 0= 1
Could you please elaborate on what you are trynig to do?
• ###### 2. Re: Adding digits 1234 = 1+2+3+4 = 10= 1+ 0= 1
Looks like numerology, and would most likely require a custom function.  Do you have access to the Advanced version of FMP?
• ###### 3. Re: Adding digits 1234 = 1+2+3+4 = 10= 1+ 0= 1
"1" is the digital value of "1234".(as "9" is the DV of "99") Numerology it may be but the concept is common. It seems there must be a formula out there somewhere. A custom function wouldn't be necessary. A calculation would do. If I figure out one I'll post it.
• ###### 4. Re: Adding digits 1234 = 1+2+3+4 = 10= 1+ 0= 1

RickWhitelaw wrote:
A custom function wouldn't be necessary. A calculation would do. If I figure out one I'll post it.

A custom function may not be necessary, but unless the number of digits (or at least the maximum number of digits) is known in advance (and fairly small), this will require a recursive calculation - and that means either a custom function or a looping script.

RickWhitelaw wrote:
"1" is the digital value of "1234".(as "9" is the DV of "99")

What on Earth is a "digital value"?

• ###### 5. Re: Adding digits 1234 = 1+2+3+4 = 10= 1+ 0= 1

Here's a CF that seems to work, even for large input numbers:

Function Name: Digital Value

Function Parameters: Number

DigitalValue ( number ) =

Let ( \$TheNumber = GetAsNumber ( Number );
Case ( \$TheNumber < 10; \$TheNumber; DigitalValue ( Left ( \$TheNumber; 1 ) + DigitalValue ( Right ( \$TheNumber; Length ( \$TheNumber ) - 1 ) ) )
)
)

• ###### 6. Re: Adding digits 1234 = 1+2+3+4 = 10= 1+ 0= 1

Howdy,

A digital value is pretty much what the title of the post shows.  Add all the digits together to come up with a sum, and if the sum is multidigit, add those digits together, and on and on until you are left with a single digit...the digital value.

They're sometimes used as verification criteria for fast-checking previous work, among other things.

(I always thought that doing the work right in the first place was better, though...but that's me)

• ###### 7. Re: Adding digits 1234 = 1+2+3+4 = 10= 1+ 0= 1

I believe the sum of digits is called digit sum, and the output of repeating the process on the result until a single-digit number is reached is called repeated digital sum or digital root.

However, I must correct my earlier statement: while digit sum requires a recursive calculation, digital root can be calculated simply by Raman's formula =

1 + Mod ( number  - 1 ; 9 )

• ###### 8. Re: Adding digits 1234 = 1+2+3+4 = 10= 1+ 0= 1
Thanks comment, I learned something new today!  Or, learned something that I forgot in school!  Definitely explains why the result of my CF didn't change when I kept adding 9's to my initial number...
• ###### 9. Re: Adding digits 1234 = 1+2+3+4 = 10= 1+ 0= 1

Comment wrote:

"What on Earth is a "digital value"?"

Sorry . . . I meant digital root!