4 Replies Latest reply on Jan 25, 2013 6:13 AM by kosmo

# Avoid "scientific"/exponential notation in number-calculation

Dear Experts,

I'm trying to make a custom function that produces long numbers. It's some kind of Code and the calculation might then look for the digit on position 43 or else.

Unfortunately, the cf doesn't work if, by chance, the code ends with several zeros, because filemaker switches to its exponential notation like "9,0e+11" instead of 900000000000 and text-functions like "Middle ()" give wrong results.

The crucial part of the cf goes like

\$NumberA * \$NumberB ^ \$NumberC;

For testing, I'm now trying to get a result of "0" from a formula like Middle (9 * 10^13; 2; 1) or Middle (GetAsText (9 * 10^13); 2; 1). Doesn't work, gives ",".

Does anyone know a trick?

Thank You very much!

Christian Bredlow

• ###### 1. Re: Avoid "scientific"/exponential notation in number-calculation

Try using the Mod() and Div() functions instead of Middle().

1 of 1 people found this helpful
• ###### 2. Re: Avoid "scientific"/exponential notation in number-calculation

Hello,

sounds wonderful. Thank You so much. Something like

Right (Div (\$TheCode;10^\$PositionFromRight); 1)

should work, e.g.. I have to think for other examples.

Christian Bredlow

• ###### 3. Re: Avoid "scientific"/exponential notation in number-calculation

Christian Bredlow wrote:

Something like

Right (Div (\$TheCode;10^\$PositionFromRight); 1)

should work,

It's best to use only numeric functions when dealing with a number. To extract the digit at the n-th position (from right), try =

Mod ( Div ( number ; 10 ^ ( n - 1 ) ) ; 10 )

• ###### 4. Re: Avoid "scientific"/exponential notation in number-calculation

Thank You so much, too. Works! Two-day-brain-torture has an end...

Unfortunately I can only give one "right answer".

Christian Bredlow