Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Real Number to character

Status
Not open for further replies.

marrisa

Technical User
Nov 26, 2004
8
TT
Dear members,

Is it possible to change a real number variable to a character variable such that the value of the number is the same but only the type is changed?

Regards
Marrisa
 
You cannot change the type of a variable. If you want to convert a real variable to a character variable you need to use for example a write statement like:
Code:
   write(string,*) x
(supposed that string is long enough to contains the value of the variable).
you can also use a formatted write such as:
Code:
   write(string,'(1PG13.6)') x


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top