I want to convert an integer to a string in Julia.
When I try:
a = 9500
b = convert(String,a)
I get the error:
ERROR: LoadError: MethodError: Cannot `convert` an object of type Int64 to an object of type String
This may have arisen from a call to the constructor String(...),
since type constructors fall back to convert methods.
in include_from_node1(::String) at ./loading.jl:488
in process_options(::Base.JLOptions) at ./client.jl:265
in _start() at ./client.jl:321
while loading ..., in expression starting on line 16
I am not sure why Int64's cannot be converted to strings.
I have tried defining a
as different types, for example a = UInt64(9500)
, but get similar errors.
I know this is very basic and have tried looking for the correct way to do this here, but couldn't figure it out.