Could you please elaborate on what you are trynig to do?
Looks like numerology, and would most likely require a custom function. Do you have access to the Advanced version of FMP?
"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.
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.
"1" is the digital value of "1234".(as "9" is the DV of "99")
What on Earth is a "digital value"?
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 ) ) )
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)
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 )
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...
"What on Earth is a "digital value"?"
Sorry . . . I meant digital root!