I would like to write a small program with an input field and an output field

Input: Type in any number
Output: Show at what decimal place the number occurs

The funny thing is that I think it should be not that hard to program a query to find the numbers easily. However I dont know where to startâ€¦

I guess we need to make a const Pi and then we need to define a random number let OtherNumber. We loop though const PI and check if (if statement) the random number we need to loop though is somewhere available inside of the number PI. Then we need to declare that if (if Statement) this number is showing up then display the decimal place at one which the number occurs.

These are my thoughts right now and I would really aprechiate if someone with more experience can let me know his / her thought process.

@skaparate That sounds easy lolâ€¦ and when I have the index I need to add the number of digits from the second number and then I have the answerâ€¦

It sounds easy, however I also need an input field to be able to type in the number and then find the index and calculate the digits from the input numberâ€¦

Thanks to @camperextraordinaire he showed me an easy way to find a number simply with the use of IndexOf. Here is the solution:

It works great, however I need to find the decimal place for 1 000 000 numbers and I dont want to type in all numbers by myself lol

Is there any way to automate these numbers and save the result inside a CSV file?

Here is how I would do it (theoretically):

We need to generate an array with the numbers 1 - 999 999 and then we need to execute the calculation for each number. Therefore we need to loop though the array we created and then add each single number inside the field â€śNumber to findâ€ť, afterwards we want to execute the calculation and save the result inside an online CSV file (for example Google Docs). This should be done for each single number until we reached the end of the array.

Is this the correct way to automate an array of numbers?