0

I am trying to extract certain digits of a real, so I used parenthesis as if characters does, but I failed. For example, if num=58278, I did num(4:4) to extract 10 digits and failed.

So, I am planning to change the type of 'num' to character, and extract certain digits by using parenthesis, and change it to real type data. I mean, I hope to change num=58278 to num='58278', then num(4:4) will be 10 digits.

The question is, how can I change a number(real or integer) to character, and how can I reverse that task?

I tried command 'char()' already to change integer to character, but the output was a strange symbol, not a number.

Ian Bush
  • 6,996
  • 1
  • 21
  • 27
  • And see [this question](https://stackoverflow.com/questions/24071722/converting-a-string-to-an-integer-in-fortran-90) for converting strings back to integers. – veryreverie Jan 25 '22 at 09:34
  • 1
    Probably, that question suggest me about 'format', but I didn't know about that yet. However, now I know exactly what I should be learned. – huritsu Jan 25 '22 at 09:59

0 Answers0