b3ta.com talk
You are not logged in. Login or Signup
Home » Talk » Message 6234100 (Thread)

Are you talking about coding?

(, Wed 17 Jun 2009, 17:50, archived)
Because you could do something with substrings
or, I think, mod might be able to do it.
But don't quote me on that.
(, Wed 17 Jun 2009, 17:51, archived)
Not possible using a math approach.
Plus if the string is an even number of numbers - problem.
(, Wed 17 Jun 2009, 17:55, archived)
no, arithmetic.
if it were coding, it'd be peasy..

echo $num[floor(strlen($num)/2)];

(, Wed 17 Jun 2009, 18:02, archived)
All decimal numbers can be written "long-hand" as
c0 × 100 + c1 × 101 + c2 × 102 + ... + cn × 10n (more typically written as cn...c2c1c0; e.g. 439 is 4 × 102 + 3 × 101 + 9 × 100.)

you should first find n, divide it by two, and you've got the power of 10 the middle digit multiplies. From there, it gets a little complicated.
(, Wed 17 Jun 2009, 18:16, archived)